PKIX path building failed
Java can't build a trusted certificate chain
Seen in Java (javax.net.ssl.SSLHandshakeException), Maven, Gradle, Spring, Jenkins
Java could not link the server certificate to any CA in its truststore (cacerts).
Common causes
- A corporate proxy or private CA that is not in the JDK cacerts file.
- The server omits its intermediate certificate; Java does not fetch missing intermediates by default.
- An old JDK whose cacerts lacks newer root CAs.
- The app uses a custom truststore (javax.net.ssl.trustStore) that lacks the CA.
How to fix it
- Import the CA: keytool -importcert -cacerts -alias corp-ca -file ca.crt (Java 9+; default password changeit).
- Fix the server to send the full chain.
- Update the JDK to get a current cacerts.
- Check which JDK and truststore the app actually uses (java -XshowSettings:properties -version).
Got a different message? Paste it into the error explainer.
Related errors
- [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed · Python couldn't verify the server's certificate
- certificate verify failed: Hostname mismatch, certificate is not valid for · The certificate doesn't cover this hostname
- javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure · The server rejected the TLS handshake
- No subject alternative DNS name matching example.com found · The certificate doesn't cover this hostname
- x509: certificate signed by unknown authority · Go doesn't trust the certificate's issuer
- x509: certificate is valid for X, not Y · The certificate doesn't cover this hostname
- remote error: tls: handshake failure · The server rejected the TLS handshake
- The SSL connection could not be established, see inner exception. · .NET could not complete the TLS handshake
- The remote certificate is invalid according to the validation procedure · .NET doesn't trust the server's certificate
- The request was aborted: Could not create SSL/TLS secure channel. · .NET Framework could not negotiate TLS
- cURL error 60: SSL certificate problem: unable to get local issuer certificate · PHP cURL can't verify the server's certificate
- stream_socket_enable_crypto(): SSL operation failed with code 1 · PHP failed to set up TLS on a stream