title: LDAPS : Simple bind failed
body: <p>I'm facing issue connecting to LDAPS from my application. I have imported all necessary certificates on JRE keystore.</p>
  
  <p>I'm able to make calls to LDAPs when I put the following string in java.security</p>
  
  <pre><code>jdk.tls.disabledAlgorithms=MD5, SSLv3, DSA, RSA keySize &lt; 2048
  </code></pre>
  
  <p>When I change this line to </p>
  
  <pre><code>jdk.tls.disabledAlgorithms=MD5, DSA, DESede, DES_CBC, DHE, RC4, SSLv3, ECDH_anon, DH_anon, NULL, DH keySize &lt; 768, RSA keySize &lt; 2048
  </code></pre>
  
  <p>my connection fails with following error:</p>
  
  <pre><code>Caused by: javax.naming.CommunicationException: simple bind failed: testxxxxl.xxxx.com:636 [Root exception is java.net.SocketException: Socket closed]
      at com.sun.jndi.ldap.LdapClient.authenticate(LdapClient.java:218)
      at com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2740)
      at com.sun.jndi.ldap.LdapCtx.&lt;init&gt;(LdapCtx.java:316)
      at com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(LdapCtxFactory.java:193)
      at com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(LdapCtxFactory.java:211)
      at com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(LdapCtxFactory.java:154)
      at com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtxFactory.java:84)
      at org.jboss.as.naming.InitialContext.getDefaultInitCtx(InitialContext.java:122)
      ... 72 more
  Caused by: java.net.SocketException: Socket closed
      at java.net.SocketInputStream.socketRead0(Native Method)
      at java.net.SocketInputStream.read(SocketInputStream.java:152)
      at java.net.SocketInputStream.read(SocketInputStream.java:122)
      at sun.security.ssl.InputRecord.readFully(InputRecord.java:442)
      at sun.security.ssl.InputRecord.read(InputRecord.java:480)
      at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:934)
      at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1332)
      at sun.security.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:709)
      at sun.security.ssl.AppOutputStream.write(AppOutputStream.java:122)
      at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
      at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
      at com.sun.jndi.ldap.Connection.writeRequest(Connection.java:431)
      at com.sun.jndi.ldap.Connection.writeRequest(Connection.java:404)
      at com.sun.jndi.ldap.LdapClient.ldapBind(LdapClient.java:358)
  </code></pre>
  
  <p>In wireshark it complains about certificate invalid.My question is if my certificate is invalid, it shouldn't be working with this line as well.</p>
  
  <pre><code>jdk.tls.disabledAlgorithms=MD5, SSLv3, DSA, RSA keySize &lt; 2048
  </code></pre>
  
  <p>Please help me to solve the issue.</p>