What the certificate needs
- It is in Local Computer → Personal (certlm.msc) and has a private key.
- Enhanced key usage Server Authentication (1.3.6.1.5.5.7.3.1).
- The DC’s fully qualified DNS name is in the subject alternative name, e.g.
dc01.corp.local. If you connect via the domain name (corp.local), that name must be in the certificate too. - The issuing CA is trusted on the DC and on all clients.
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
- Port 636 accepts connections and drops them immediately: no valid certificate found. Usually Server Authentication, the private key or the DC name in the SAN is missing.
- Client reports “unable to get local issuer certificate”: the CA is missing from the client’s trust store, on Linux e.g. in
/etc/ssl/certsorTLS_CACERTinldap.conf. More in the guide unable to get local issuer certificate. - Name mismatch: the application connects via the IP address or short name. Use the name that is in the certificate.
- Java applications (e.g. Jira, Keycloak) only trust their own trust store. The CA must go there, see import a CA into Java cacerts.
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.