Search code examples
sslmonoldapnovelledirectory

mono.security.dll novell.directory.ldap.dll Secure Socket Layer - SSL


Imported certificates like this:

certmgr /add /v /c /ctl "selfsignedroot.cer" /s /r localMachine root
certmgr /add /v /c /ctl "server.cer" /s /r localMachine root
certmgr /add /v /c /ctl "server.cer" /s /r localMachine CA
certmgr /add /v /c /ctl "server.cer" /s /r localMachine MY

My code looks like this

LdapConnection conn = new LdapConnection();
conn.SecureSocketLayer=true;
conn.Connect("server",636);
conn.bind("cn=user,o=root","password");

I get error comming from mono.security.dll. Error code: -2146762487. Which means it failed to validate root certificate. Looking at the certificate via mmc it is shown as trusted.


Solution

  • Mono.Security.dll is cross platform and its origins are on Linux. As such it does not use Windows CryptoAPI-based certificate stores, but it's own stores (and tools).

    You can look at the Mono project's wiki, e.g. the security FAQ, and in particular the article named Using Trusted Roots Respectfully.