Java Certificates
Pods
Inable to find valid certification path to requested target
05-01-2026, source: StackOverflow
org.springframework.web.client.ResourceAccessException: I/O error on POST request for "https://a.b/c": PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
The certificate needs to be imported into cacerts TrustStore of the used JDK.
-
Export a
Base64-encoded ASCII, single certificateas a.pemfile from the browser (usually the first option) and save it aswhatever-certificate.pem. -
(Optional) Locate the
cacertsTrustStore location of the used Java.echo $JAVA_HOME/lib/security/cacerts -
Import the certificate into
cacertsTrustStore. Don’t forget to change thewhatever-certificate-aliasalias.sudo keytool -import -trustcacerts -alias whatever-certificate-alias -file /Users/Foo/whatever-certificate.pem -keystore $JAVA_HOME/lib/security/cacerts