Attempts to use LDAPS fail with Failed to connect to host, Reason: Failed to connect to LDAP host "<Host>" with user "<Domain>\<User>". Code(21, 81) (21)

Attempts to use LDAPS fail with Failed to connect to host, Reason: Failed to connect to LDAP host "<Host>" with user "<Domain>\<User>". Code(21, 81) (21)

230
Created On 11/10/26 10:59 AM - Last Modified 11/10/26 12:55 PM


Symptom


Attempts to use LDAP over SSL (LDAPs) fail with the following error message in the LDAP Integration portion of the web GUI.
Status:
Failed to connect to host, Reason: Failed to connect to LDAP host "<Host>" with user "<Domain>\<User>". Code(21, 81) (21)
Summary:
LDAP verify check ended with errors (-1)


Connection attempts using LDP.exe to the DC results in the following error.
ld = ldap_sslinit("<LDAP_Provider>", 636, 1);
Error <0x51> = ldap_set_option(hLdap, LDAP_OPT_PROTOCOL_VERSION, LDAP_VERSION3);
Error <0x51> = ldap_connect(hLdap, NULL);
Server error: <empty>
Error <0x51>: Fail to connect to <LDAP_Provider>.


The following events in the System log on the Vault server correlate with the connection attempts with LDP.exe.


Event ID: 36884 - 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 <LDAP_Provider>. The SSL connection request has failed. The attached data contains the server certificate.


Event ID: 36888 - The following fatal alert was generated: 43. The internal error state is 552.
These events are explained in the following technet article.
https://technet.microsoft.com/en-us/library/dn786445.aspx


Ping attempts to the target using Fully Qualified Domain Name are successful, but resolve the short name instead of the FQDN.


Environment


N/A;v8.0;v8.0 Beta;8.1;v8.2;v8.5;v8.6;v9.0;v9.1;v9.2;9.3;9.5;9.6;9.7;9.8;9.9;9.9.5;9.10;10.0;10.1;10.2;10.3;10.4;10.5;10.6;10.7;10.8;v9.97;v9.8.3;v9.8.1;v9.7.5;10.9;10.10;11.1;11;12.2;14.6 Privileged Access Manager (PAM, self-hosted) PAS on Prem only
This is not applicable to Privilege Cloud


Cause


The certificate used by the LDAP provider fails verification because the Hosts file references the short name, which is not present in the certificate.
 


Resolution


The first entry in the Hosts file is the actual record and everything afterwards is an alias. Since the record was referencing the shortname (which was not present in the cert), the validation of the cert failed. By reversing the order, the record will now reference the FQDN and pass certificate validation. The following is the appropriate format to use in the Hosts file for validating the cert correctly.


<IP Address>     DC1.Cyberark.com      DC1


Additional Information


Details

SYMPTOM:

 

Attempts to use LDAP over SSL (LDAPs) fail with the following error message in the LDAP Integration portion of the web GUI.

Status:

Failed to connect to host, Reason: Failed to connect to LDAP host "<Host>" with user "<Domain>\<User>". Code(21, 81) (21)

Summary:

LDAP verify check ended with errors (-1)

 

Connection attempts using LDP.exe to the DC results in the following error.

ld = ldap_sslinit("<LDAP_Provider>", 636, 1);

Error <0x51> = ldap_set_option(hLdap, LDAP_OPT_PROTOCOL_VERSION, LDAP_VERSION3);

Error <0x51> = ldap_connect(hLdap, NULL);

Server error: <empty>

Error <0x51>: Fail to connect to <LDAP_Provider>.

 

The following events in the System log on the Vault server correlate with the connection attempts with LDP.exe.

 

Event ID: 36884 - 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 <LDAP_Provider>. The SSL connection request has failed. The attached data contains the server certificate.

 

Event ID: 36888 - The following fatal alert was generated: 43. The internal error state is 552.

These events are explained in the following technet article.

https://technet.microsoft.com/en-us/library/dn786445.aspx

 

Ping attempts to the target using Fully Qualified Domain Name are successful, but resolve the short name instead of the FQDN.

 

PROBLEM:

1. The certificate used by the LDAP provider fails verification because the Hosts file references the short name, which is not present in the certificate.
2. LDP test works, but LDAP integration over 636 is still failing because the certificate does not have the IP defined in the Subject Alternative Name or Principle Name fields and IP is being used in the LDAP Host configuration.

 

 

SOLUTION:

 

1. The first entry in the Hosts file is the actual record and everything afterwards is an alias. Since the record was referencing the shortname (which was not present in the cert), the validation of the cert failed. By reversing the order, the record will now reference the FQDN and pass certificate validation. The following is the appropriate format to use in the Hosts file for validating the cert correctly.

<IP Address>     DC1.Cyberark.com      DC1

2. Set the IP setting of the Host entry for the Domain Controller in the LDAP Integration to the server address defined in the certificate instead of the IP address. Make sure the hosts file on the vault is configured for the host per solution# 1.




Actions
  • Print
  • Copy Link

    https://knowledgebase.paloaltonetworks.com/KCSArticleDetail?id=kA1hj0000001bvCCAQ&lang=en_US&refURL=http%3A%2F%2Fknowledgebase.paloaltonetworks.com%2FKCSArticleDetail