Enable LDAPS on a domain controller

A domain controller speaks LDAPS on port 636 as soon as a suitable certificate is in the computer store. There is no switch for it. What matters is that the certificate meets every requirement, otherwise the port simply stays silent.

What the certificate needs

With an enterprise CA (AD CS) there is usually nothing to do: DCs auto-enroll a certificate from the “Domain Controller” or “Kerberos Authentication” template and LDAPS already works.

Request a certificate without your own CA

For an external or Linux-based CA, create the request on the DC itself so the private key never leaves the server. File ldaps.inf:

[NewRequest]
Subject = "CN=dc01.corp.local"
KeyLength = 2048
Exportable = FALSE
MachineKeySet = TRUE
ProviderName = "Microsoft RSA SChannel Cryptographic Provider"
ProviderType = 12
RequestType = PKCS10
KeyUsage = 0xa0

[EnhancedKeyUsageExtension]
OID = 1.3.6.1.5.5.7.3.1

[Extensions]
2.5.29.17 = "{text}"
_continue_ = "dns=dc01.corp.local&"
_continue_ = "dns=corp.local"
certreq -new ldaps.inf ldaps.csr
# submit ldaps.csr to the CA, save the certificate as ldaps.cer
certreq -accept ldaps.cer

certreq -accept joins certificate and key in the computer store. If you have a PFX instead, import it with certlm.msc or Import-PfxCertificate -CertStoreLocation Cert:\LocalMachine\My. The certificate converter builds a PFX from PEM files.

Load it without a reboot

The DC picks the certificate itself, normally at startup. To do it right away, use the rootDSE attribute renewServerCertificate, for example with this LDIF file:

dn:
changetype: modify
add: renewServerCertificate
renewServerCertificate: 1
-
ldifde -i -f renew.ldf

If several suitable certificates are in the store, the DC takes any of them. To force a specific one, also put it into the store of the “Active Directory Domain Services” service (certlm.msc → snap-in “Service account” → NTDS → Personal). That store takes precedence.

Test

# port reachable?
Test-NetConnection dc01.corp.local -Port 636

# show certificate and chain (from Linux, or OpenSSL on Windows)
openssl s_client -connect dc01.corp.local:636 -showcerts

# bind over LDAPS
ldapsearch -H ldaps://dc01.corp.local -x -D "admin@corp.local" -W -b "dc=corp,dc=local" "(sAMAccountName=jdoe)"

On Windows you can also use ldp.exe: Connection → Connect, port 636, tick SSL. The global catalog is reachable encrypted on port 3269. The LDAP filter builder creates matching search filters for users and groups.

Typical errors

Background: Microsoft has been pushing LDAP signing and channel binding for years. If applications still bind with clear-text passwords over plain LDAP on port 389, move them to LDAPS before the defaults get stricter.

FAQ

Does the domain controller need a reboot?

No. With renewServerCertificate the DC loads the new certificate immediately. A reboot works just as well.

Is a self-signed certificate enough?

Technically yes, but then every client must trust exactly that certificate. An internal CA is much easier in the long run because renewals change nothing on the clients.

What about StartTLS on port 389?

The DC supports it too, with the same certificate. Many applications only offer LDAPS, so port 636 is the usual route.

Sources and documentation