Novell LDAP C# - Novell.Directory.Ldap - Has anybody made it work?

后端 未结 7 1492
走了就别回头了
走了就别回头了 2021-02-02 18:11

I\'m trying to use the library released by Novell (Novell.Directory.Ldap). Version 2.1.10.

What I\'ve done so far:

  • I tested the connection with an appl

7条回答
  •  太阳男子
    2021-02-02 18:59

    I had gone through this scenario, for me Novell LDAP service running in Kubernetes container. I tried adding CA certificate to the Mono trust store, which will add the file inside "/usr/share/.mono/certs/Trust" in linux container. But nothing did work, still Novell connect not successful for LDAP 636 port.

    Finally I made it work in below way:

    LdapConnection Connection = new LdapConnection();
        Connection.SecureSocketLayer = true;
        Connection.UserDefinedServerCertValidationDelegate += new
                Novell.Directory.Ldap.RemoteCertificateValidationCallback(LdapSSLHandler);
    
        public bool LdapSSLHandler(object sender, System.Security.Cryptography.X509Certificates.X509Certificate certificate, System.Security.Cryptography.X509Certificates.X509Chain chain,
                      System.Net.Security.SslPolicyErrors sslPolicyErrors)
        {
            if (sslPolicyErrors == sslPolicyErrors.None)
            {
                return true;   //Is valid
            }
    
            if (certificate.GetCertHashString() == "YOUR CERTIFICATE HASH KEY") // Thumbprint value of the certificate
            {
                return true;
            }
    
            return false;
        }
    

提交回复
热议问题