LDAP bind with TLS

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top