Search code examples
javaldapconnection

Connection reset while binding to ldap sever


I have a java application in which I use LDAP authentication.I am trying to connect to a LDAP server in java using com.novell.ldap.* . Below is the code

import com.novell.ldap.LDAPConnection;
LDAPConnection userConn = new LDAPConnection();
userConn.connect(host, port);
userConn.bind(3, userdn, password.getBytes("UTF8"));

Ideally this code should be able to bind the user with ldap server, Instead I am getting a connection reset at 4th line userConn.bind

LDAPException: Connection lost waiting for results from cdcgcorplb01.corp.twcable.com:636 (91) Connect Error
java.net.SocketException: Connection reset
    at com.novell.ldap.Connection$ReaderThread.run(Unknown Source)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.net.SocketException: Connection reset
    at java.net.SocketInputStream.read(SocketInputStream.java:209)
    at java.net.SocketInputStream.read(SocketInputStream.java:141)
    at java.net.SocketInputStream.read(SocketInputStream.java:223)
    at com.novell.ldap.asn1.ASN1Identifier.<init>(Unknown Source)

Any suggestions where I can look at to solve this.


Solution

  • This was because of the test LDAP server to which I was trying to connect to.