So after some work on it here’s the solution to enable it. I found a few posts on line but they didn't seem to be written very clear.
I found that all you really have to do is give the DC the correct type of certificate and it will automatically do LDAP over SSL. An important requirement here is that I didn’t want to force connections to use LDAP over SSL but rather just enable it to work if something wants to use it.
Environment
Microsoft Active Directory: Windows 2008
Certificate Authority: Windows 2008 Server
Enable The Domain Controller Authentication Certificate Template on the Certificate Authority
Starting with your Certificate Authority (CA) we need to make sure that the Domain Controllers (DC's) can enroll with the CA in order to obtain the correct Certificates. There is a Certificate Template for this that exists by default. To configure this Logon to the CA and open Server Manager and then expand the roles till you get the view below.
- Expand the tree till you see the Certificate Templates folder and look for the Domain Controller Authentication the default existing template.
- Then expand the CA server and check if its listed under its Certificate Templates folder as well. If the Domain Controller Authentication is listed in both places then it exists and is enabled. If it isn't under the CA's Folder then we need to enable the Domain Controller Authentication Certificate Template.
- Right click Certificate Templates under the CA, Click New, then and Click Certificate Template to Issue. Select the Domain Controller Authentication and then click OK.
Note: If you want to change how long the certificate is valid for or other values. You can edit the template before we enroll the Domain Controllers.
Obtain the "Domain Controller Authentication" Certificate on the Domain Controller
We need to enroll our Domain Controllers with the CA to obtain the new Domain Controller Authentication certificate. This will have to be configured on all of the Domain Controllers. But to start should tested on just one of them before continuing to configure it on all of them
- Login into the Domain Controller you want to test the LDAP over SSL.
- Open a command prompt as an administrator. To open a command prompt as an administrator, click Start. In Start Search, type Command Prompt. At the top of the Start menu, right-click Command Prompt, and then click Run as administrator. If the User Account Control dialog box appears, confirm that the action it displays is what you want, and then click Continue.
- To open Microsoft Management Console (MMC), type mmc, and then press ENTER.
- Click File, click Add/Remove Snap-in, select Certificates from the available snap-ins, and then click Add.
- In the Certificates snap-in, click Computer Account, and then click Next.
- In the Select Computer, click Local Computer, and then click Finish and then OK.
- In the console tree, expand Certificates - Local Computer, expand Personal, and then expand Certificates.
- Note: Trying to do this on a remote computers Cert store didn't work as the options to enroll wasn't there.
- Right Click and choose All Task, Click Request New Certificate. A Before You Begin window will prompt you. Click Next.
- Select Active Directory Enrollment Policy. And Click Next.
- Check Domain Controller and Domain Controller Authentication and click Next.
- In the Certificate Enrollment, a status window should show the Domain controller enrolling and then Status: Succeeded. Click Finish.
You can test that LDAPS is now working by trying to connect with LDAP with SSL. To confirm that LDAP over SSL is configured successfully follow the guide:
if you have access on server there is a tool install with active directory name ldp.exe
so just start it with start-->run
Now new window open you need to make a connection by given host and port
when connect you should find the similar message on screen
If faild to bind over given host and port you should receive the following error:
ld = ldap_sslinit("localhostd", 636, 1);
Error 81 = ldap_set_option(hLdap, LDAP_OPT_PROTOCOL_VERSION, 3);
Error 81 = ldap_connect(hLdap, NULL);
Server error: <empty>
Error <0x51>: Fail to connect to localhostd.
Now enjoy the post and configure the SSL for Active Directory 2008.