LDAP connection over SSL does not work with parameter "com.sun.jndi.ldap.connect.timeout"

I faced the problem that my application could not connect to the LDAP server over SSL (LDAPS: // ldapserver: 636). This would always throw an exception:

2014-08-07 12:52:13,486 ERROR : simple bind failed: ldapserver:636
javax.naming.CommunicationException: simple bind failed: ldapserver:636 [Root exception is javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake]

      

But after removing this line of code:

environments.put("com.sun.jndi.ldap.connect.timeout", "10000"); 

      

It works. Can anyone explain how the timeout property affects the LDAP SSL connection?

Thanks, Stoper

+3


source to share


1 answer


SSL handshake takes some time for key / certificate exchange before setting up SSL channel. You can increase the time to 20 seconds / 20,000ms and check if this is really the problem.



0


source







All Articles