首页 > 解决方案 > 无法使用 Novell C# 包在 xamarin.forms 中建立安全 ldap 连接

问题描述

我正在使用 VisualStudio 2019 Xamarin.Forms。我可以用下面的代码建立 ldap 连接。我正在使用 Novell Directory Ldap NetStandard ldap 客户端库。用户可以使用此代码进行身份验证。但是我找不到一种方法来使用公司 ldap 管理员提供的根证书建立安全的 ldap 连接。

        using (var cn = new LdapConnection())
        {
            // connect
            cn.SecureSocketLayer = true;
            cn.Connect("207.154.211.212", 389); //636 ssl
            // bind with an username and password
            // this how you can verify the password of an user
            try
            {
                cn.Bind("uid=adam,ou=People,dc=localdomain,dc=local", "423fw342ed23");
                Console.WriteLine(" ::: SUCCESS  ::: ");
            }
            catch
            {
                Console.WriteLine(" ::: LDAP CONNECTION ERROR ::: ");                    
            }  
        }

标签: c#androidiosxamarin.formsldap

解决方案


推荐阅读