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 certificateerror 20 at 0 depth lookup: unable to get local issuer certificateThis 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.
To resolve this issue, reconstruct the certificate files to ensure a complete and valid chain.
openssl x509 -in <certificate_file> -text -noout | grep -E "Subject:|Issuer:"-----BEGIN CERTIFICATE----- and -----END CERTIFICATE----- tags. Ensure there are no leading or trailing spaces.