javax.naming.CommunicationException: simple bind failed

戏子无情 提交于 2019-11-30 08:26:44

The question is a little older now but quite common. Attempting to explain it in short:

The issue happens due to missing SSL certificates in the JRE keystore.

For an LDAPS or HTTPS connection, the java runtime needs to use the respective SSL certificate for creating a secured connection with the server at the other end.

For picking up the SSL certificate from its keystore, the certificate should first be installed in the Java Key store. The 'keytool' command helps to import/export certificates into and from Java Keystore.

keytool –import -file adserv.crt -keystore <location to keystore> 

When its missing, you get a:

"sun.security.provider.certpath.SunCertPathBuilderException: 
unable to find valid certification path to requested target". 

So, all you need to do is install the certificate before establishing a secured connection.

Mark Bramnik

You're trying to work with LDAP over SSL (ldaps in the protocol name + your exception points to that). You don't have certificates, so the SSL doesn't work. You have 2 choices:

  1. Don't work with SSL
  2. Configure certificates properly.

I also got the same error like below. Adding fix, If this helps someone.

I got from IBM WAS 8.5 while connecting to LDAP.

I had to make sure that "Keystore name" is selected to NodeDefaultKeystore and aliases are "none"

SSL certificate and key management > SSL configurations > NodeDefaultSSLSettings

Caused by: javax.naming.CommunicationException: simple bind failed: xxxxxx-xxx.xxxxx.xxx:636 [Root exception is javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake]

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!