protected DirContext getDirContext() throws NamingException, CommunicationException, ConnectException {
DirContext dirCtx = null;
try {
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 {