4
votes

I have faced the problem that my application couldn't connect to LDAP server via SSL (LDAPS://ldapserver:636). It was always throwing the 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 removed this line of code :

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

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

Thanks, Stoper

1
Hmm. It shouldn't do that. The connection must have succeeded for there to be something for the server to close prematurely. - user207421

1 Answers

-1
votes

SSL handshake needs some time to exchange the keys/certificates before establishing an SSL channel. You could increase the time out to 20 sec/20000 ms and check if this indeed is the problem.