javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException

If you like a tip written by other Samebug users, mark is as helpful! Marks help our algorithm provide you better solutions and also help other users.
tip

Set the 'mail.smtp.ssl.trust' system property to an smtp host, like 'smtp.gmail.com'.

tip

If you're using wiremock, configure your code to accept wiremock self-signed certificate or create a keystore and certificate that are trusted by your HTTP client and configure wiremock to use that


rafael

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

  • One additional comment: I also tested by setting port to 5223 with the same result. {quote} INFO: Completed initialization Feb 15, 2011 2:36:02 PM hudson.TcpSlaveAgentListener <init> INFO: JNLP slave agent listener started on TCP port 58299 Feb 15, 2011 2:36:02 PM javax.jmdns.impl.HostInfo newHostInfo WARNING: Could not find any address beside the loopback. Feb 15, 2011 2:36:32 PM hudson.plugins.im.IMConnectionProvider$ConnectorRunnable run INFO: Trying to reconnect java.io.EOFException: input contained no data <-->at org.xmlpull.mxp1.MXParser.fillBuf(MXParser.java:3003) <-->at org.xmlpull.mxp1.MXParser.more(MXParser.java:3046) <-->at org.xmlpull.mxp1.MXParser.parseProlog(MXParser.java:1410) <-->at org.xmlpull.mxp1.MXParser.nextImpl(MXParser.java:1395) <-->at org.xmlpull.mxp1.MXParser.next(MXParser.java:1093) <-->at org.jivesoftware.smack.PacketReader.parsePackets(PacketReader.java:325) <-->at org.jivesoftware.smack.PacketReader.access$000(PacketReader.java:43) <-->at org.jivesoftware.smack.PacketReader$1.run(PacketReader.java:70) Feb 15, 2011 2:37:35 PM hudson.plugins.jabber.im.transport.JabberIMConnection retryConnectionWithLegacySSL INFO: Retrying connection with legacy SSL javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException <-->at sun.security.ssl.Alerts.getSSLException(Alerts.java:192) <-->at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1665) <-->at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:258) <-->at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:252) <-->at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1165) <-->at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:154) <-->at sun.security.ssl.Handshaker.processLoop(Handshaker.java:610) <-->at sun.security.ssl.Handshaker.process_record(Handshaker.java:546) <-->at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:913) <-->at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1158) <-->at sun.security.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:652) <-->at sun.security.ssl.AppOutputStream.write(AppOutputStream.java:78) <-->at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:220) <-->at sun.nio.cs.StreamEncoder.implFlushBuffer(StreamEncoder.java:290) <-->at sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:294) <-->at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:140) <-->at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:229) <-->at java.io.BufferedWriter.flush(BufferedWriter.java:253) <-->at java.io.FilterWriter.flush(FilterWriter.java:100) <-->at org.jivesoftware.smack.PacketWriter.openStream(PacketWriter.java:258) <-->at org.jivesoftware.smack.PacketWriter.writePackets(PacketWriter.java:186) <-->at org.jivesoftware.smack.PacketWriter.access$000(PacketWriter.java:40) <-->at org.jivesoftware.smack.PacketWriter$1.run(PacketWriter.java:76) Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid cer <-->at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:324) <-->at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:224) <-->at sun.security.validator.Validator.validate(Validator.java:235) <-->at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:147) <-->at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:230) <-->at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:270) <-->at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1144) <-->... 18 more Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target <-->at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:197) <-->at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:255) <-->at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:319) <-->... 24 more {quote}
    via by Sorin Sbarnea,
  • One additional comment: I also tested by setting port to 5223 with the same result. {quote} INFO: Completed initialization Feb 15, 2011 2:36:02 PM hudson.TcpSlaveAgentListener <init> INFO: JNLP slave agent listener started on TCP port 58299 Feb 15, 2011 2:36:02 PM javax.jmdns.impl.HostInfo newHostInfo WARNING: Could not find any address beside the loopback. Feb 15, 2011 2:36:32 PM hudson.plugins.im.IMConnectionProvider$ConnectorRunnable run INFO: Trying to reconnect java.io.EOFException: input contained no data <-->at org.xmlpull.mxp1.MXParser.fillBuf(MXParser.java:3003) <-->at org.xmlpull.mxp1.MXParser.more(MXParser.java:3046) <-->at org.xmlpull.mxp1.MXParser.parseProlog(MXParser.java:1410) <-->at org.xmlpull.mxp1.MXParser.nextImpl(MXParser.java:1395) <-->at org.xmlpull.mxp1.MXParser.next(MXParser.java:1093) <-->at org.jivesoftware.smack.PacketReader.parsePackets(PacketReader.java:325) <-->at org.jivesoftware.smack.PacketReader.access$000(PacketReader.java:43) <-->at org.jivesoftware.smack.PacketReader$1.run(PacketReader.java:70) Feb 15, 2011 2:37:35 PM hudson.plugins.jabber.im.transport.JabberIMConnection retryConnectionWithLegacySSL INFO: Retrying connection with legacy SSL javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException <-->at sun.security.ssl.Alerts.getSSLException(Alerts.java:192) <-->at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1665) <-->at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:258) <-->at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:252) <-->at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1165) <-->at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:154) <-->at sun.security.ssl.Handshaker.processLoop(Handshaker.java:610) <-->at sun.security.ssl.Handshaker.process_record(Handshaker.java:546) <-->at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:913) <-->at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1158) <-->at sun.security.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:652) <-->at sun.security.ssl.AppOutputStream.write(AppOutputStream.java:78) <-->at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:220) <-->at sun.nio.cs.StreamEncoder.implFlushBuffer(StreamEncoder.java:290) <-->at sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:294) <-->at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:140) <-->at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:229) <-->at java.io.BufferedWriter.flush(BufferedWriter.java:253) <-->at java.io.FilterWriter.flush(FilterWriter.java:100) <-->at org.jivesoftware.smack.PacketWriter.openStream(PacketWriter.java:258) <-->at org.jivesoftware.smack.PacketWriter.writePackets(PacketWriter.java:186) <-->at org.jivesoftware.smack.PacketWriter.access$000(PacketWriter.java:40) <-->at org.jivesoftware.smack.PacketWriter$1.run(PacketWriter.java:76) Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid cer <-->at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:324) <-->at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:224) <-->at sun.security.validator.Validator.validate(Validator.java:235) <-->at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:147) <-->at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:230) <-->at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:270) <-->at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1144) <-->... 18 more Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target <-->at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:197) <-->at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:255) <-->at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:319) <-->... 24 more {quote}
    via by Sorin Sbarnea,
  • Intermittent errors
    via by David Clark,
  • Send mail using Java Mail API
    via Stack Overflow by Avi
    ,
    • javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException at sun.security.ssl.Alerts.getSSLException(Alerts.java:192) at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1665) at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:258) at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:252) at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1165) at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:154) at sun.security.ssl.Handshaker.processLoop(Handshaker.java:610) at sun.security.ssl.Handshaker.process_record(Handshaker.java:546) at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:913) at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1158) at sun.security.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:652) at sun.security.ssl.AppOutputStream.write(AppOutputStream.java:78) at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:220) at sun.nio.cs.StreamEncoder.implFlushBuffer(StreamEncoder.java:290) at sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:294) at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:140) at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:229) at java.io.BufferedWriter.flush(BufferedWriter.java:253) at java.io.FilterWriter.flush(FilterWriter.java:100) at org.jivesoftware.smack.PacketWriter.openStream(PacketWriter.java:258) at org.jivesoftware.smack.PacketWriter.writePackets(PacketWriter.java:186) at org.jivesoftware.smack.PacketWriter.access$000(PacketWriter.java:40) at org.jivesoftware.smack.PacketWriter$1.run(PacketWriter.java:76) Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid cer at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:324) at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:224) at sun.security.validator.Validator.validate(Validator.java:235) at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:147) at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:230) at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:270) at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1144) ... 18 more Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:197) at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:255) at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:319) ... 24 more

    Users with the same issue

    rocday
    rocday1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    poroszd
    poroszd1 times, last one,
    59 more bugmates