Java SSLException "PKIX path building failed: unable to find valid certification path to requested target" — Java cannot build the trust chain. JVM truststore ($JAVA_HOME/lib/security/cacerts) lacks the server's CA or intermediate. Fixes: (1) keytool -import into cacerts, (2) -Djavax.net.ssl.trustStore for an alternate truststore, (3) -Djavax.net.debug=ssl,handshake for diagnostics.
Below: details, example, related, FAQ.
# Download CA cert from server
$ echo | openssl s_client -connect server:443 -showcerts 2>/dev/null | \
openssl x509 -out server-ca.crt
# Import into Java cacerts
$ sudo /bin/keytool -import \
-alias server-ca \
-keystore /lib/security/cacerts \
-storepass changeit \
-file server-ca.crt
# Debug app
$ java -Djavax.net.debug=ssl:handshake MyAppSSL/TLS is the encryption protocol that protects data between the browser and server. Our tool analyzes the certificate, chain of trust, TLS version, and knownvulnerabilities.
Issuer, validity period, signature algorithm, covered domains (SAN), and validation type (DV/OV/EV).
Full chain verification: from leaf certificate through intermediates to root CA.
Protocol version (TLS 1.2/1.3), cipher suites, Perfect Forward Secrecy (PFS) support.
Set up a monitor — get Telegram and email alerts 30/14/7 days before expiration.
SSL certificate monitoring
TLS config audit
HTTPS as ranking factor
customer trust
www and subdomains.Strict-Transport-Security header forces browsers to always use HTTPS.SSL certificate monitoring, check history and alerts 30 days before expiry.
Sign up freeCopy into an app-specific jks + -Djavax.net.ssl.trustStore. JDK updates won't reset it.
For dev: a TrustManager that accepts everything. Never ship that in prod code.
-Djavax.net.ssl.trustStore in MAVEN_OPTS / GRADLE_OPTS, or <jvmArgs> in the build files.