PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target; nested exception is javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
ERROR restutil.py::get::128::_collect_https_esx_logsThread0] GET call failed for https://esxi-1.vcf.example.com/cgi-bin/vm-support.cgi due to HTTPSConnectionPool(host='esxi-1.vcf.example.com', port=443): Max retries exceeded with url: /cgi-bin/vm-support.cgi (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])")))
The custom CA root certificate should be added to SDDC-Manager trust stores.
To add custom CA root certificate to SDDC Manager (versions prion to 4.1) trust store:
cat /etc/vmware/vcf/commonsvcs/trusted_certificates.key
Sample Output:
q_0EZjUI7Z^B7V@2A+ ----> Key Store Password
keytool -importcert -alias <aliasname> -file <certificate file> -keystore /etc/vmware/vcf/commonsvcs/trusted_certificates.store --storepass <Key from Step # 4>
<Note: if the above fails run the command without the storepass and paste the key from step #4 once prompted:>
keytool -importcert -alias <aliasname> -file <certificate file> -keystore /etc/vmware/vcf/commonsvcs/trusted_certificates.store
Issue a command similar to the following to import the certificate into the java trust store:
keytool -importcert -alias <aliasname> -file <certificate file> -keystore /etc/alternatives/jre/lib/security/cacerts --storepass changeit
Notes:
keytool -list -v -keystore /etc/vmware/vcf/commonsvcs/trusted_certificates.store -storepass <Key from Step # 4>
/opt/vmware/vcf/operationsmanager/scripts/cli/sddcmanager_restart_services.sh
To delete a stale certificate in trust store : (Please reach out to Broadcom support if you are not sure)
keytool -list -v -keystore /etc/vmware/vcf/commonsvcs/trusted_certificates.store -storepass <Key from Step # 4>
keytool -delete -alias <alias from Step #1> -keystore /etc/vmware/vcf/commonsvcs/trusted_certificates.store
To add custom CA root certificate to SDDC Manager (versions 4.1 and later) trust store:
Public API can also be used from VCF 4.1 to add/delete trusted certificates to the SDDC manager trust store.
/opt/vmware/vcf/operationsmanager/scripts/cli/sddcmanager_restart_services.sh
To add custom CA root certificate to SDDC Manager (versions 4.5.1 and later) trust store:
Workaround:
The attached python script can also be run from SDDC Manager to add the trusted certificates to the SDDC Manager.
This issue is being checked by Diagnostics for VMware Cloud Foundation.
The check is as follows: