Renew changed/expiring/expired LDAPS certificate for vCenter SSO Identity Provider
search cancel

Renew changed/expiring/expired LDAPS certificate for vCenter SSO Identity Provider

book

Article ID: 371578

calendar_today

Updated On:

Products

VMware vCenter Server 8.0 VMware vSphere ESXi

Issue/Introduction

  • vCenter Server triggers an alarm stating: "Identity Source LDAP Certificate is about to expire".
  • Active Directory domain users are unable to authenticate and receive an "Invalid credentials" error on the vCenter login screen.
  • The ssoAdminServer.log on the vCenter Server reports ServerDownLdapException and cannot establish ldap connection errors similar to the following:

    /var/log/vmware/sso/ssoAdminServer.log

YYYY-MM-DD HH:MM:SS WARN ssoAdminServer [548 : pool-2-thread-8] [OpId=####-####-####-###-##:] [com.vmware. identity.idm.server. ServerUtils] ldaps: //<<server_name>>: 636, CN=#####, CN=User cannot bind connection

YYYY-MM-DD HH:MM:SS ERROR ssoAdminServer [548 : pool-2-thread-8] [OpId=####-####-####-###-##:] [com.vmware. identity.idm.server. ServerUtils] cannot establish ldap connection with URI: [ldaps://<<server_name>> : 636] because [com. vmware.identity. interop. ldap. ServerDownLdapException] with reason [Can't contact LDAP server] therefore will try to attempt to use secondary URIs, if applicable

YYYY-MM-DD HH:MM:SS ERROR ssoAdminServer [548 : pool-2-thread-8] [OpId=####-####-####-###-##:] [com.vmware.identity.idm.server. Provider. BaseLdapProvider] com. vmware. identity. interop. ldap. ServerDownLdapException: Can't contact [code: -1]

YYYY-MM-DD HH:MM:SS ERROR ssoAdminServer [548 : pool-2-thread-8] [OpId=####-####-####-###-##:] [com.vmware.identity.idm.server. IdentityManager] Failed to find person users [Criteria : searchString=, domain=######] in tenant [vsphere. local]

YYYY-MM-DD HH:MM:SS ERROR ssoAdminServer [548 : pool-2-thread-8] [OpId=####-####-####-###-##:] [com.vmware.identity.idm.server. ServerUtils] Exception 'com. vmware. identity. interop. ldap. ServerDownLdapException: Can't contact LDAP server\nLDAP com. vmware. identity. interop. ldap. ServerDownLdapException: Can't contact LDAP server

websso.log explicitly reports that the LDAPS certificate is not trusted:

/var/log/vmware/sso/websso.log

YYYY-MM-DD HH:MM:SS ERROR websso [85: tomcat-http -- 46] [CorId=####] [com. vmware. identity. interop. ldap. OpenLdapClientLibrarcertificate not trusted: Subject (CN=<FQDN>, OU=<OU_Name>, O=<Organization>, L=<City>, ST=<State>, C=<Country>

Environment

vCenter Server 7.x

vCenter Server 8.x

Cause

  • LDAPS Identity Provider SSO authentication relies on the LDAPS service machine certificate to be valid for authentication to succeed
  • If the LDAPS certificate expires, authentication via this Identity Provider will fail

Resolution

Take a snapshot of the VCSA VM before making any changes. If the vCenter is part of a Linked Mode setup, ensure there is a backup and offline snapshot for all replicating nodes. Refer: VMware vCenter in Enhanced Linked Mode pre-changes snapshot (online or offline) best practice

Note: If the vCenter is in ELM, perform the following steps on only one of the linked vCenter servers, since the Identity Provider configuration will be replicated to the other linked vCenter servers. Also, it does not matter which vCenter is chosen for the certificate update. The configuration needs to be removed and re-created to update the LDAPS certificate, it cannot be Edited.

  1. Connect to the vCenter Server Appliance via SSH and login as root user.
  2. Check the certificate presented by the Domain Controller to confirm if it has expired or changed by running this command: openssl s_client -connect domain_controller.example.com:636 -showcerts
  3. Review the notAfter date in the certificate output to determine your next steps:
    1. If the certificate is expired on the Active Directory/LDAP server itself, engage your Active Directory or PKI team to renew and install a valid LDAPS certificate on the Domain Controller before making any changes in vCenter.
    2. If the certificate is valid but vCenter is still holding the old, expired version, proceed with the next steps. 
  4. Remove the existing Identity Source configuration and re-add it using the new LDAPS machine certificate chain:
    1. In vCenter navigate to Administrator > Single-Sign-ON > Configuration > Identity Sources 
    2. Note the current LDAPS configuration, as the details are needed to re-create the LDAPS configuration.
    3. Remove the existing LDAPS configuration and re-create it using the new LDAPS machine certificate. For detailed steps, refer: Configuring a vCenter Single Sign-On Identity Source using LDAP with SSL.

Additional Information

When preparing certificate files for the vCenter LDAPS Identity Provider (IdP) configuration, use the following steps to convert a .p7b file to the required Base64 format:

  1. Import the Certificate: While working with a .p7b file, import the certificate into a folder of the client machine being used. If using Windows, open the Certificate Manager for the local machine (certlm.msc) to do this.
  2. Export as Base64: Export the newly imported certificate as Base-64 encoded X.509. This will generate a certificate in the .cer format.
    1. Open this .cer file in Notepad to view it in clear text. Additionally, double-clicking the .cer file should open it successfully in the standard Windows Certificate viewer.
  3. Clean Up Local Store: Once the .cer file is successfully exported, delete the certificate you initially imported from the .p7b file from the folder it was saved to.

vCert tool can also be used to update the LDAPS certificates without removing and recreating the identity provider in vSphere with option 3 followed by option 11. If the vCenter is in ELM this will also remediate the other nodes of the ELM with no additional steps or service restarts. 

vCert - Scripted vCenter expired certificate replacement