/** * Converts a property value to a ClientAuth enum. If the input string is empty or null, returns * <code>ClientAuth.NEED</code>. * @param prop the property string. * @return the ClientAuth. * @throws IllegalArgumentException if the property value is not "NONE", "WANT", "NEED", or empty/null. */ public static ClientAuth fromPropertyValue(String prop) { if (prop == null || prop.length() == 0) { return NEED; } return ClientAuth.valueOf(prop.toUpperCase()); } }
private X509Util.ClientAuth getClientAuth(final ZKConfig config) { return X509Util.ClientAuth.fromPropertyValue(config.getProperty(x509Util.getSslClientAuthProperty())); }