I am currently trying to convert a Java code into C# in order to establish a SSL LDAP connection.
In Java, I can specify the certificate’s location with the following: System.setProperty("javax.net.ssl.trustStore", "D:\\xnet\\ldap\\cacerts");
What is the equivalent in C# ? How can I specify where the certificate is ? (LdapConnection.ClientCertificates being read-only)
Thank you very much
The ClientCertificates property is a CertificateCollection instance, you should be able to add a certificate to this collection:
connection.ClientCertificates.Add(myCert);
The X509Certificate would need to be loaded youself, normally from one of the Windows certificate stores, see this page on MSDN for details on how to load a certificate.