1
尝试使用LdapDirectoryIdentifier通过ldap进行身份验证以与openldap服务器进行通信。使用ldap进行身份验证的C#ASP.NET应用程序
代码片断
dapDirectoryIdentifier ldi = new LdapDirectoryIdentifier("ldap.com", 636);
LdapConnection lconn = new LdapConnection(ldi);
lconn.SessionOptions.ProtocolVersion = 3;
lconn.Bind();
lconn.Dispose();
运行代码给了我一个异常的bind()的说明LDAP服务器不可用。但在查看我的netstat后,连接就建立了。没有其他错误消息可用。
有什么想法?
这部分是答案。也没有证书,所以我不得不绕过使用lconn.SessionOptions.VerifyServerCertificate = new VerifyServerCertificateCallback((con,ver)=> true); – adroit