Unable to turn on SecureSocketLayer with DirectoryServices.Protocols.LdapConnection
I am trying to fix a bug with SSL in a product and noticed that although the code sets SSL to be true, in the next line in the code SSL is still at false. I wrote a unit test for this and the unit test confirms my suspicions. [TestMethod] public void SecureSocketLayerSetToTrue( ) { var ldapConnection = new LdapConnection( new LdapDirectoryIdentifier( "ldap.test.com", 636 )); ldapConnection.SessionOptions.SecureSocketLayer = true; Assert.IsTrue( ldapConnection.SessionOptions.SecureSocketLayer ); } The test fails. Is there something here that I am missing? It turns out that the way that the