简体   繁体   中英

LDAPS connection with ASP.Net/C#

I have a connection string for LDAP protocol

ldap://ldap.example.com:636/DC=users,DC=buyers

which works fine.

But I need to use a LDAPS connection :

ldaps://ldap.example.com/DC=users,DC=buyers

which does show up in ldp.exe windows form when I test the connection.

Unfotunately it does not work in the Asp.Net application. I get "Unknown error (0x80005000)".

I am not sure whether LDAPS string is even possible with Asp.Net. I downloaded the source code into LDAPConnection.cs class and was unable to find any valuable information.

The method you found that works is indeed using LDAPS:

ldap://ldap.example.com:636/DC=users,DC=buyers

That's the only way to do it. I do that in one of my existing projects. It doesn't understand "LDAPS://".

If you don't believe me :) fire up Wireshark as you debug. When it connects, you'll see the SSL handshake to your domain controller.

Port 636 is only for LDAPS. Port 389 is the non-SSL port.

If you have more than one domain, you can use port 3269 for the global catalog via SSL.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM