Advertisement
Guest User

Untitled

a guest
Dec 7th, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. LdapConnection _connection = new LdapConnection(new LdapDirectoryIdentifier(m_DomainName, m_PortNo));
  2. _connection.Timeout = TimeSpan.FromMinutes(10);
  3. _connection.SessionOptions.ProtocolVersion = 3;
  4. _connection.SessionOptions.SecureSocketLayer = true;
  5.  
  6. _connection.SessionOptions.VerifyServerCertificate = (ldapCon, serverCertificate) =>
  7. {
  8. //TODO: Verify server certificate
  9. return true;
  10. };
  11. _connection.SessionOptions.QueryClientCertificate = (con, trustedCAs) => null;
  12.  
  13. _connection.AuthType = AuthType.Basic;
  14. _connection.Credential = new NetworkCredential(m_UserName, m_Password);
  15.  
  16. _connection.Bind();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement