I am working on a requirement where I need to validate user with active directory account. For this I have used LdapConnection with PrincipalContext and in all cases I am able to validate user without SSL. But I need to use validate user with SSL. I have also used the correct port i.e 636/TCP LDAP SSL
But whenever I tried to use port 636 and set the contextoption to ContextOptions.Negotiate | ContextOptions.SecureSocketLayer am getting error "Server Could not be contacted."
Following is my code
using (principalContext = new PrincipalContext(ContextType.Domain, ldapServerIp, null, ContextOptions.Negotiate | ContextOptions.SecureSocketLayer, userName, password))
{
bool isCredentialValid = principalContext.ValidateCredentials(userName, password);
}
My Ldap server address is abc.com:636. If I remove the port 636 and use the default ContextOption than it is authenticating the users. Does anyone ever resolve this type of issue. Any help will be appreciated.