Error: "unable to get issuer certificate" while replacing vCenter Server certificates
search cancel

Error: "unable to get issuer certificate" while replacing vCenter Server certificates

book

Article ID: 320211

calendar_today

Updated On:

Products

VMware vCenter Server VMware vSphere ESXi

Issue/Introduction

When attempting to replace the Machine SSL certificate, solution user certificates, or trusted root certificates in vCenter Server, the process fails with one of the following errors:

  • [CERTIFICATE] Replace cert Failed: Exception found (No issuer certificate for certificate in certification path found.)
  • error 2 at 1 depth lookup: unable to get issuer certificate
  • error 20 at 0 depth lookup: unable to get local issuer certificate

Cause

This issue occurs when the certificate chain provided is incomplete, out of order, or contains formatting errors (such as extra spaces or header metadata outside the BEGIN/END blocks). vCenter requires a strict PEM format where every intermediate CA and the root CA are present and correctly linked via their Subject/Authority Key Identifiers.

Resolution

To resolve this issue, reconstruct the certificate files to ensure a complete and valid chain.

  1. Verify the certificate chain order using openssl. Ensure the leaf certificate's issuer matches the subject of the intermediate, and the intermediate's issuer matches the root CA. Use the following command to inspect the fields:

    openssl x509 -in <certificate_file> -text -noout | grep -E "Subject:|Issuer:"

  2. Reconstruct the certificate PEM file (e.g., machinecertificatechain.pem) in the following order:
    • Leaf Certificate (if replacing Machine SSL directly)
    • Secondary Intermediate Certificate
    • Primary Intermediate Certificate
    • Root Certificate

      Example

      ----BEGIN CERTIFICATE-----
      [leaf certificate encoded 64 hash]
      -----END CERTIFICATE-----
      ----BEGIN CERTIFICATE-----
      [secondary intermediate CA encoded 64 hash]
      -----END CERTIFICATE-----
      -----BEGIN CERTIFICATE-----
      [primary intermediate CA encoded 64 hash]
      -----END CERTIFICATE-----
      -----BEGIN CERTIFICATE-----
      [root CA certificate encoded 64 hash]
      -----END CERTIFICATE-----

      Note:
      • For the "secondary intermediate CA" the Issuer should be the Subject of the "primary intermediate CA"
      • For the "primary intermediate CA" the Issuer should be the Subject of the "root CA certificate"
      • For the "root CA certificate" the Issuer should be the Subject of the "root CA certificate"
      • If this is not the case there is one or more certificate missing and the files received by the CA should be double checked.

  3. Open the file in a text editor (e.g., Notepad++) and remove any text outside of the -----BEGIN CERTIFICATE----- and -----END CERTIFICATE----- tags. Ensure there are no leading or trailing spaces.

  4. If you are using the vSphere Client UI, ensure the leaf certificate is placed in the Machine SSL Certificate field and only the intermediate/root CA certificates are placed in the Chain of Trusted Root Certificates field.

  5. Retry the certificate replacement workflow.

Additional Information

Related KBs: