Cannot connect to LDAP SSL with Error 81 on server with CNAME interface

Error Encountered
Cannot connect to Internet Directory Service (LDAP) server: Check your network connection or modify your Address Book settings

Set up
LDAP server is a Canonical name interface to, which serves the LDAP SSL service with server name "" in the SSL cert.

In Outlook Account setup, the server name is inputted as "", with proper authentication.

Cannot establish SSL connection to the server

Already diagnosed with Ldp, with following result.
ld = ldap_sslinit("", 636, 1);
Error 0 = ldap_set_option(hLdap, LDAP_OPT_PROTOCOL_VERSION, 3);
Error 81 = ldap_connect(hLdap, NULL);
Server error: <empty>
Error <0x51>: Fail to connect to

Windows System Logs - Source: SChannel
The certificate received from the remote server does not contain the expected name. It is therefore not possible to determine whether we are connecting to the correct server. The server name we were expecting is The SSL connection request has failed. The attached data contains the server certificate.

Question Info

Last updated December 4, 2018 Views 15,258 Applies to:
Done further research and stumbled upon 

Win 7/2008 R2: 
Win Vista/2008:

While the hotfix cannot be installed for some reason for my case, after adding the registry as mentioned below the issue has been resolved.
  1. Start Registry Editor.
  2. Locate the following key in the registry: 
  3. Create a new REG_DWORD value named UseHostnameAsAlias, and set the value to anything other than zero.
  4. Exit Registry Editor, and then restart the computer.
While this is not 100% what we are looking as a solution, this seems to be the best possible solution so far until MS release a fix on it.

1 person was helped by this reply


Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.