if (this.isTlsSecurityConnection()) {
dirCtx = new InitialLdapContext(this.getParams(true), null);
StartTlsResponse tls = (StartTlsResponse) ((InitialLdapContext) dirCtx).extendedOperation(new StartTlsRequest());
if (this.isTlsFreeSecurityConnection()) {
// Set the (our) HostVerifier
tls.setHostnameVerifier(new MyTLSHostnameVerifier());
SSLSocketFactory sslsf = null;
try {
TrustManager[] tm = new TrustManager [] {new MyX509TrustManager()};
SSLContext sslC = SSLContext.getInstance("TLS");
sslC.init(null, tm, null);