Search in sources :

Example 1 with NoVerificationTrustManager

use of org.apache.directory.ldap.client.api.NoVerificationTrustManager in project jackrabbit-oak by apache.

the class LdapIdentityProvider method createConnectionConfig.

/**
     * Creates a new connection config based on the config.
     * @return the connection config.
     */
@Nonnull
private LdapConnectionConfig createConnectionConfig() {
    LdapConnectionConfig cc = new LdapConnectionConfig();
    cc.setLdapHost(config.getHostname());
    cc.setLdapPort(config.getPort());
    cc.setUseSsl(config.useSSL());
    cc.setUseTls(config.useTLS());
    // todo: implement better trustmanager/keystore management (via sling/felix)
    if (config.noCertCheck()) {
        cc.setTrustManagers(new NoVerificationTrustManager());
    }
    if (enabledSSLProtocols != null) {
        cc.setEnabledProtocols(enabledSSLProtocols);
    }
    return cc;
}
Also used : NoVerificationTrustManager(org.apache.directory.ldap.client.api.NoVerificationTrustManager) LdapConnectionConfig(org.apache.directory.ldap.client.api.LdapConnectionConfig) Nonnull(javax.annotation.Nonnull)

Aggregations

Nonnull (javax.annotation.Nonnull)1 LdapConnectionConfig (org.apache.directory.ldap.client.api.LdapConnectionConfig)1 NoVerificationTrustManager (org.apache.directory.ldap.client.api.NoVerificationTrustManager)1