0

I am facing issue while authentication with LDAP server. Application code(.ear) is deployed in WebLogic Server.In WebLogic server, code is not connecting with LDAP, and the same code setting is working in the tomcat server without any issue. Note: Sometimes only the first time it is authenticating with WebLogic server. Java version :java version "1.7.0_80" and weblogic server : 10.3.6.0 Keystore is working perfectly and I have tested with simple java program.

System.setProperty("java.naming.ldap.factory.socket", "javax.net.ssl.SSLSocketFactory");
System.setProperty("javax.net.ssl.trustStore","TheKeyStore.keystore");
System.setProperty("javax.net.ssl.keyStorePassword", "changeit");
JSSESocketFactory jsseFactory = new JSSESocketFactory(null);
ld = new LDAPConnection(jsseFactory);
ld.connect(host,port);

Here is the exception i am getting while connecting ldap in weblogic.

netscape.ldap.LDAPException: JSSESocketFactory.makeSocket XXXXXXXXXXXXXXXXXXXXXXXXXXXX:636, Remote host closed connection during handshake (91); Cannot connect to the LDAP server
at netscape.ldap.factory.JSSESocketFactory.makeSocket(Unknown Source)
at netscape.ldap.LDAPConnSetupMgr.connectServer(Unknown Source)
at netscape.ldap.LDAPConnSetupMgr.openSerial(Unknown Source)
at netscape.ldap.LDAPConnSetupMgr.connect(Unknown Source)
at netscape.ldap.LDAPConnSetupMgr.access$000(Unknown Source)
at netscape.ldap.LDAPConnSetupMgr$1.run(Unknown Source)
at java.lang.Thread.run(Thread.java:662)

I have checked TLS protocol and it is not working. Please advice for this issue

Plusdigit
  • 3
  • 3
  • Kindly use these flags to get more details. They are described [here] (https://docs.oracle.com/cd/E24329_01/web.1211/e21049/weblogic_xml.htm#WBAPP663) -Djavax.net.debug=all -Dssl.debug=true -Dweblogic.StdoutDebugEnabled=true – rcastellcastell Aug 19 '20 at 19:36
  • In JDK7 TLSv1.2 is available only upwards of update 95 or so. Simplest test is to install JDK8 and perform your test. Now 10.3.6 might not support JDK8. In that case, install the latest version of JDK7 and test. – souser Aug 20 '20 at 02:51

1 Answers1

0

As per this question, Java 7 defaults to TLS 1.0, which can cause the error you mention if that protocol is not accepted.

JustAnotherDeveloper
  • 2,061
  • 2
  • 10
  • 24