Connection to LDAPS sever RRS feed

  • Question

  • User159475852 posted


    I can't connect my c# application to a LDAPS server.

    Earlier, i was able to connect to LDAP server by using the following code:

    string srvr = ConfigurationManager.AppSettings["LDAP_SERVER"]; //where "LDAP_SERVER" is server url ex: "LDAP//domain_name".

    DirectoryEntry entry = new DirectoryEntry(srvr, usr, pwd); // usr-domain user id , pwd-domain password

    object nativeObject = entry.NativeObject;

    But, recently we had to update our servers to LDAPS. The above code does not work with LDAPS server (server url looks like "LDAPS://ldap.domain_name").

    Can anyone suggest on how to authenticate users over LDAPS server?

    Thanks in advance.



    Monday, March 16, 2020 11:53 AM

All replies

  • User753101303 posted


    A Windows admin forum could be better but it seems they use port 636 instead. What happens if you try LDAP://ldap.domain_name:636 ?

    Monday, March 16, 2020 12:52 PM
  • User159475852 posted

    Thanks for the quick reply.
    I tried to add port number as well like" ldaps://ldap.domain_name:636" but no success. Actually we need to use LDAPS protocol instead of LDAP. So is there a solution for LDAPS?

    Tuesday, March 17, 2020 1:37 AM
  • User753101303 posted

    What I meant is that every documentation I found seems to use ldap and port 636 for testing rather than a ldaps prefix.

    Try maybe https://support.microsoft.com/en-us/help/321051/how-to-enable-ldap-over-ssl-with-a-third-party-certification-authority and "Verifying an LDAPS connection".

    If it still doesn't work a Windows admin forum could be better. Also there rather than telling just that it doesn't work, tell them what actually happens (you don't have an error message ?)

    Tuesday, March 17, 2020 7:52 AM