Adding Trusted Root Certificate to the vCenter Certificate Store fails
search cancel

Adding Trusted Root Certificate to the vCenter Certificate Store fails

book

Article ID: 422693

calendar_today

Updated On:

Products

VMware vCenter Server VMware vSphere ESXi

Issue/Introduction

When attempting to add a Trusted Root Certificate to the vCenter Server Certificate Store via the vSphere Client UI or CLI, the task fails. This issue is frequently seen when integrating external appliances like HPE OneView or during certificate renewals.

Symptoms

    • The task Add a Trusted Root Certificate in the vSphere Client results in an infinite spinning circle or an 'Internal Server Error'.
    • Attempting the import via CLI fails to display the certificate in the UI after a refresh.
    • In /var/log/vmware/certificatemanagement/certificatemanagement-svcs.log, you find one of the following errors:

      [tomcat-exec-8 INFO com.vmware.cerfiticatemanagement.vapi.impl.setup.AuthzPermissionValidator] User ####\#### has required privileges (CertificateManagement.Administer) to invoke API com.vmware.vcenter.cestificate_management.create
      [tomcat-exec-8 INFO com.vmware.cerfiticatemanagement.impl.trustedroots.TrustedRootsChainCreator] TrustedRootsChain create operation is initiated 
      [tomcat-exec-8 INFO com.vmware.cerfiticatemanagement.impl.trustedroots.TrustedRootsChainCreator] create vAPI call for Id : ###############
      [tomcat-exec-8 INFO com.vmware.cerfiticatemanagement.impl.trustedroots.TrustedRootsChainCreator] cert already exist for Id : ###############
      [tomcat-exec-8 INFO com.vmware.cerfiticatemanagement.impl.telemetry.TelemetryData] Attempting VAC stats push ....
      [tomcat-exec-8 WARN com.vmware.cerfiticatemanagement.impl.telemetry.TelemetryData] Publishing telemetry data to VAC failed with exception : Failed : HTTP error code : 400

 

Environment

  • VMware vCenter Server 7.x
  • VMware vCenter Server 8.x

Cause

This issue occurs due to one of the following reasons:

  1. Duplicate Subject Key Identifier (SKI): The incoming root certificate has an SKI identical to an entry already present in the TRUSTED_ROOTS store.
  2. Invalid Certificate Chain: vCenter (particularly 8.x) requires a fully valid CA certificate. The certificate may be missing the Key Usage extension (specifically 'Certificate Sign') or is not a complete Base-64 encoded PEM chain.

Resolution

To resolve this issue, follow steps below:

Scenario 1: Duplicate Subject Key Identifier

  1. Take a powered-off snapshot of the vCenter Server.
  2. List the certificates in the store to identify the conflicting Alias: /usr/lib/vmware-vmafd/bin/vecs-cli entry list --store TRUSTED_ROOTS --text | less
  3. Find the certificate that needs to be removed and make a note of the Alias. Example: Alias : ####################################2e7f
  4. Using the Alias ID located in Step 2, run the command to save the certificate to /root/ folder. /usr/lib/vmware-vmafd/bin/vecs-cli entry getcert --store TRUSTED_ROOTS --alias ####################################2e7f --output /root/<aliasID>.cer
  5. Unpublish the old certificate from VMDIR: /usr/lib/vmware-vmafd/bin/dir-cli trustedcert unpublish --cert /root/<aliasID>.cer

Note: Provide the SSO Password when prompted.

Scenario 2: Invalid or Incomplete Certificate Chain

  1. Verify the certificate properties using OpenSSL to ensure it is a valid CA : openssl x509 -in [certificate_file] -text -noout
  2. Ensure the X509v3 Key Usage field includes Certificate Sign and CRL Sign. If these are missing, the certificate will be rejected by vCenter 8.x.
  3. Ensure the certificate is in Base-64 encoded PEM format.
  4. If the certificate is valid, import it 

Import the Trusted Root Certificate via CLI.

  1. Add the new certificates to the TRUSTED_ROOTS store: /usr/lib/vmware-vmafd/bin/dir-cli trustedcert publish --cert /root/new-cert.cer

    Note: When prompted, provide the SSO Administrator credentials.

  2. Perform force refresh of VECS to sync certificate from VMDIR: /usr/lib/vmware-vmafd/bin/vecs-cli force-refresh

  3. Confirm that the certificate is no longer present, using below command: /usr/lib/vmware-vmafd/bin/vecs-cli entry list --store TRUSTED_ROOTS --text | grep <aliasID>

    Note: Output of the command should not be listing the Alias ID that was removed in above steps.

  4. Restart all services on the vCenter Servers, ensuring that all services start and respond normally, and that login and management of the environment are functioning properly.

    service-control --stop --all && service-control --start --all

Import the Trusted Root Certificate via vCenter UI.

  1. Login to the vCenter UI with SSO Credentials.
  2. Navigate to Administration > Certificate management > Import Trusted root certificate.
  3. Reboot the vCenter to take the changes effect.

Additional Information

Reference KB: https://knowledge.broadcom.com/external/article?articleNumber=326288