【问题标题】:Ignoring Certificate errors when doing AD search using DirectorySearcher使用 DirectorySearcher 进行 AD 搜索时忽略证书错误
【发布时间】:2023-02-10 19:38:24
【问题描述】:

我正在尝试连接到 Active Directory 以搜索用户。我托管的服务器存在证书问题,因此我的代码未在测试服务器上运行。我需要一种使用 DirectorySearcher 类忽略证书错误的方法。

我尝试使用 LDAPConnection 并添加了以下行

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

但是我需要使用相同的方法,但是使用 DirectorySearcher 和 DirectoryEntry。

有没有人有办法可以帮助我???

【问题讨论】:

    标签: c# active-directory


    【解决方案1】:

    根据 this SO answer 看来这是不可能的。我将不得不使用我试图避免的方法。

    【讨论】: