LDAP bind with TLS

  • Thread starter Thread starter Argirop
  • Start date Start date
A

Argirop

Hi,

I am trying to connect to a SUN's LDAP server using the following code:

....
using System.DirectoryServices.Protocols;
.....

NetworkCredential creds = new NetworkCredential("uid=userid, ou=people,
dc=domain, dc=com", "password");

LdapConnection connect = new LdapConnection(new
LdapDirectoryIdentifier("ldap.domain.com:389"), creds, AuthType.Basic);

connect.SessionOptions.StartTransportLayerSecurity(null);

connect.Bind();

The code above throws a LdapException in the "StartTransportLayerSecurity"
line. The exception message says "A local error occured". By commenting out
this line, the bind succeeds but is not using TLS .

Can some one give me any hint?

Thanks in advance
 
Back
Top