if (ldapConfig.isUseTLS()) {
// TLS does not play nicely with pooled connections
ldapContext.setPooled(false);
DefaultTlsDirContextAuthenticationStrategy tls = new DefaultTlsDirContextAuthenticationStrategy();
tls.setHostnameVerifier(new HostnameVerifier() {
@Override
public boolean verify(String hostname, SSLSession session) {
return true;
}
});