PVWA: Failed to connect to host, Reason: Failed to connect to LDAP host Code(21, 81)
Symptom
LDAP connection fails with code: Failed to connect to the directory. Failed to connect to host, Reason: Failed to connect to LDAP host. Code(21, 81) (21)
Environment
14.6 Privilege Cloud Password Vault Web Access
-
Password Vault Web Access
-
LDAP Integration
Cause
This error appears when attempting to click “Apply” for the LDAP Integration settings to test the connection for LDAPS hosts for a customer’s tenant. Support may also see code 81 errors when trying to connect to a customer's LDAP directory from PrivateArk. The errors can be due to one of the following factors listed below. Items listed based on troubleshooting process and considerations for customer involvement on their side for resolution.
- Network Connectivity such as but not limited to: cannot establish communication with Secure Tunnel servers and/or servers are on an old version(s) of the Secure Tunnel software.
- Error with Bind account password stored in Vault Internal Safe are wrong, username and password mismatch. Bind account's AD object has an issue. See the "Bind Account Verification" section below. After that, also see the following if needed: Failed to connect to LDAP host "<host>" with user "<binduser>". Code(21, 49) (21)
- SSL Certificate issues due to certificate expirations or changes that may have taken place in the customer’s environment for either LDAPS hosts or Certificate Authorities, or hostname mismatches.
- Ciphers suites listed below may not be enabled for all LDAPS/DCs access in LDAP Integration. Always check the following page for the most up-to-date list: LDAP Integration - Check encryption ciphers
- TLS_AES_256_GCM_SHA384
- TLS_AES_128_GCM_SHA256
- TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
- TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
- TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
- TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
- TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
- TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
Resolution
Troubleshooting steps for resolution are provided below. These factors may need to be eliminated step by step to determine next steps in the troubleshooting process throughout. Please note the underlined labels that indicate which party is responsible for each step or section (Support, Customer, or both).
Testing LDAP Connectivity:
Idira Support - To test the LDAP connectivity in PVWA:
1. Go to PVWA > Administrative Options > LDAP Integration > Directories > Hosts.
2. Review all hosts information to confirm the validity of the data from your perspective and is consistent to what is noted in our customer's Secure Tunnel server(s).
3. Click Apply.
4. The system will test each LDAP host connection.
If all LDAP host connections are successful, then the settings will save successfully with a message indicating this. Otherwise, there will be an error log in the lower pane to show which connection failed and the associated error message.
The error codes will indicate the cause of the failed connection. Example includes the following:
Failed to connect to host, Reason: Failed to connect to LDAP host ... Code(21, 81) (21).
Addressing Certificate Issues:
Certificate issues may require customers to obtain their updated certificates for LDAPS hosts and attach them to the case so Support can upload them on the backend for the tenant. See full details below.
Customer - CyberArk's LDAPS Certificate Tool can be used to retrieve the certificates and their respective certificate chains from each LDAPS host. See the LDAPS Certificate Tool documentation. You can download the LDAPS Certificate Tool from the Idira Marketplace. This tool performs certificate chain verification and outputs error message related to certificate chain verification failures. If any errors appear in the tool's output, please see error-related instructions in the documentation. Errors shown in that tool indicate an issue that needs to be resolved by a customer's Active Directory admins within the customer's environment. Idira Support can't resolve those errors.
Once the certificate export packages are successfully obtained, attach them to the case for Support.
Support - Upload certificates from those export packages to the backend Console UI. If new or updated certificates are replacing old ones there, remove expired certificates from the backend console as this can cause issues. You can also verify serial number and thumbprint match with what we have for LDAPS certificates.
Establishing Secure Tunnel Communication:
Customer - First, establish communication with the Secure Tunnel(s) to ensure they are online and communicating allowing LDAPS traffic to traverse. Verify this by connecting to and accessing each Secure Tunnel instances and completely stepping through the Secure Tunnel Configuration successfully. You will need your Tenant ID, your tenant's "<subdomain>_admin" account (example: acmecorp_admin), and its password.
There is the possibility that an older software version of the Secure Tunnel software that is installed could be the root cause of the issue. Check the current version of your Secure Tunnel software, first. The current version determines which upgrade steps to follow.
Instructions for versions 2.0.3 and later: Go to the documentation and select the v2.0.3 and later tab.
Instructions for versions between 1.0.6 and 2.0.1: Go to the documentation and select the v1.0.6 - v2.0.1 tab.*
Instructions for versions up to 1.0.6: Go to the documentation and select the Up to v1.0.6 tab.*
https://docs.cyberark.com/privilege-cloud-standard/latest/en/content/privilege%20cloud/privcloud-upgrade-securetunnel.htm
* For older versions of the Secure Tunnel software (version 2.0.1 and older) running on the Secure Tunnel instance(s), our customer will need to perform the upgrade by removing the previously installed Secure Tunnel software and downloading the latest version from the Idira Marketplace and installing it. IMPORTANT NOTE (for versions 2.0.1 and older): The previous version of the software needs to be removed, first. It is not recommended to install a new version over the previous version. Always ensure you're using the tab in the documentation that corresponds with your Secure Tunnel's current version number.
Bind Account Verification:
Customer - Check that bind account credentials are valid and address AD permissions and potential mismatches (user not expired, password correct, etc.). Complete all of the following steps exactly as described:
1. Log into your Privilege Cloud portal (PVWA).
2. Search your accounts for the bind account. It will be in the "VaultInternal" Safe.
3. Show password for the bind account and copy it.
4. Once you've copied the password, go into your Active Directory and find your AD object corresponding to the "VaultInternal" Safe's bind account.
5. Reset the AD object's password in your AD using the password you copied from the "VaultInternal" Safe.
6. After updating the password for your bind account's AD object, please double check that all of the following are true:
• Bind account's AD object is not locked or disabled in your AD.
• Bind account's AD object is not set to expire in your AD,
• There is no mismatch in usernames between the AD object and the "VaultInternal" Safe's bind account.
• The bind account's AD object has Read-Only access to your domain and no other permissions.
Testing SSL Communication:
Customer – To test SSL communication, on the Secure Tunnel server, use Microsoft's LDP.exe tool to establish LDAP test with Bind account username and password over port 636 with SSL to verify if LDAP / LDAPS between Vault and DC is blocked. If blocked, that points to customers possibly having internal firewall rules blocking the traffic or having SSL packet inspection.
LDP.exe is a Microsoft tool, natively installed on Domain Controllers. It's also included in Microsoft's Remote Server Administration Tools (RSAT). You'll need to engage Microsoft Support if you need assistance with the LDP tool and its related processes or documentation
Ciphers Suites Verification:
Customer - For Ciphers Suites verification: You can use the IISCrypto software to see if the latest Cipher suites are checked or any software that is supported on your environment. Please note it is your due diligence to check if the Nartac software is trusted on your side, Idira is not responsible for the use of the Nartac product. Run IISCrypto (Nartac) on DCs or run Get-TlsCipherSuite PowerShell command, however this command does not directly indicate whether they are enabled or disabled, and you cannot directly modify that command to display enabled/disabled status.
Always check the following page for the most up-to-date list: LDAP Integration - Check encryption ciphers
Ciphers suites listed need to be enabled for all LDAPS/DCs listed in the Secure Tunnel:
TLS_AES_256_GCM_SHA384
TLS_AES_128_GCM_SHA256
TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
Additional Resources and Reference Material:
Resources and reference articles for troubleshooting such as but not limited to: LDP.exe tool and IISCrypto Tool are not Idira resources. Therefore, Idira is not responsible for the use of any other software articles or resources as it is your due diligence to verify the validity of trusted software for your environment.
LDP.exe (Microsoft) - https://community.cyberark.com/s/article/How-to-use-LDP-EXE-to-check-connectivity-and-access-to-AD
Configuring Cipher Suites by GPO (Microsoft) - https://learn.microsoft.com/en-us/windows-server/security/tls/manage-tls#configuring-tls-cipher-suite-order-by-using-group-policy
IISCrypto (Nartac) - https://www.nartac.com/Products/IISCrypto/Download
You'll need to engage Microsoft's support or Nartac's support if you need assistance with their tools, their processes, or related documentation.