Recently we needed to enable LDAPS on our domain controller for internal applications. We didn’t want to purchase SSL from third-party CA and also we wanted to avoid deploying our own CA.
Below are the steps on how to do that:
- First we need SSL certificate with server’s FQDN suitable for server authentication purposes (object identifier or OID = 126.96.36.199.188.8.131.52.1). Any server has a certificate with its internal name by default. So on Domain Controller I opened Certificates MMC snap-in and searched for it.
- I copied this SSL to Local Computer/Personal store to make it available for authentication
- I copied it to Local Computer/Trusted Root to make it trusted on the server.
- I exported it without private key and import it on web server with application that needs to authenticate through LDAPS to make web server trust the certificate as well.
- To test it I run ldp.exe and connected to Domain Controller using its internal FQDN.
Note: There is no need to restart anything as SSL updates are triggered automatically from time to time. To make sure SSL update actually happened you can search for event 1221 in Directory event log.
Note: Server 2008 has enhancement that allows to store SSLs used for LDAP in Service (Active Directory) store instead of Local Computer. In this case SSL goes to the same sub-folders: Personal and Trusted Root.
- Eliminate any networking issues including firewall blocking port 636. Use telnet to check if it’s possible to connect
- If you get Event 1220 each timer application tries to connect that’s most likely certificate issue:
– check that SSL exists (see Step #1)
– check that private key is installed as well
– check that it has server’s FQDN. (see Step #1)
– check that certificate is suitable for server authentication. (see Step #1)
– check that certificate is in appropriate store folders (see Step #2 and #3)
- If you get the following whent trying to connect with ldp.exe:Error <0x0> = ldap_set_option(hLdap, LDAP_OPT_PROTOCOL_VERSION,
Error <0x51> = ldap_connect(hLdap, NULL);
most likely SSL is not trusted either on Domain Controller or on the other server you are connecting from (see Step #3 and #4)
Useful articles that helped me a lot: