Ok, so I am migrating the application from SSL connections with SSL to my LDAP server. When the application starts in non-SSL, the pool connection is working fine. However, when I switch to SSL connections, the pools no longer work.
When researching here, I realized that I never set the com.sun.jndi.ldap.connect.pool.protocol property for "plain ssl", since by default it is set to equal. I thought this was a problem.
When I implemented this change to enable "plain ssl", it did not fix the problem and connection pools were still not used.
Are there any other settings that I am missing?
Relevant Code:
Hashtable LDAPEnvironment = new Hashtable(); LDAPEnvironment.put(Context.SECURITY_AUTHENTICATION, SECURITY_AUTHENTICATION); LDAPEnvironment.put(Context.SECURITY_PRINCIPAL, SECURITY_PRINCIPAL); LDAPEnvironment.put(Context.SECURITY_CREDENTIALS, SECURITY_CREDENTIALS); LDAPEnvironment.put(Context.INITIAL_CONTEXT_FACTORY, INITIAL_CONTEXT_FACTORY); LDAPEnvironment.put(Context.PROVIDER_URL, PROVIDER_URL ); LDAPEnvironment.put(Context.SECURITY_AUTHENTICATION, "simple"); LDAPEnvironment.put("java.naming.ldap.version", versionOfLDAP ); if (ldapProtocol != null && ldapProtocol.equalsIgnoreCase("SSL")){ LDAPEnvironment.put(Context.SECURITY_PROTOCOL,"ssl"); LDAPEnvironment.put("com.sun.jndi.ldap.connect.pool.protocol","plain ssl"); } LDAPEnvironment.put("com.sun.jndi.ldap.connect.pool", "true");
source share