我遇到了我的应用程序无法通过 SSL (LDAPS://ldapserver:636) 连接到 LDAP 服务器的问题。它总是抛出异常:
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]
但是删除这行代码后:
environments.put("com.sun.jndi.ldap.connect.timeout", "10000");
它有效。谁能解释超时属性如何影响 LDAP SSL 连接?
谢谢, 塞子
最佳答案
在建立 SSL channel 之前,SSL 握手需要一些时间来交换 key /证书。您可以将超时增加到 20 秒/20000 毫秒并检查这是否确实是问题所在。
关于java - 通过 SSL 的 LDAP 连接不适用于参数 "com.sun.jndi.ldap.connect.timeout",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25178664/