if ( delegateTls )
{
connectionConfig = new LdapConnectionConfig();
connectionConfig.setLdapHost( delegateHost );
connectionConfig.setLdapPort( delegatePort );
connectionConfig.setTrustManagers( new NoVerificationTrustManager() );
ldapConnection = new LdapNetworkConnection( connectionConfig );
ldapConnection.connect();
ldapConnection.startTls();
}
else if ( delegateSsl )
{
connectionConfig = new LdapConnectionConfig();
connectionConfig.setLdapHost( delegateHost );
connectionConfig.setUseSsl( true );
connectionConfig.setLdapPort( delegatePort );
connectionConfig.setTrustManagers( new NoVerificationTrustManager() );
ldapConnection = new LdapNetworkConnection( connectionConfig );
ldapConnection.connect();
}
else