0

I am trying to connect to the Active Directory in order to search for a user. The server that I am hosting on has a certificate problem and as a result, my code is not running on the testing server. I need a way to ignore certificate errors using DirectorySearcher class.

I tried to use LDAPConnection and added the following lines

connection.SessionOptions.SecureSocketLayer = true; connection.SessionOptions.VerifyServerCertificate = new VerifyServerCertificateCallback((con, cer) => true);

However I need to use the same however using DirectorySearcher and DirectoryEntry.

Does anyone has a way that can assist me???

  • It seems according to the [this SO answer][1] seems its not possible. I will have to use the method I was trying to avoid. [1]: https://stackoverflow.com/questions/12911391/set-callback-for-system-directoryservices-directoryentry-to-handle-self-signed-s – Kaygee Del Hlobo Feb 14 '23 at 08:53

0 Answers0