My Oracle Support Banner

JDBC SSL Connections Fail With sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target (Doc ID 2897433.1)

Last updated on AUGUST 01, 2024

Applies to:

JDBC - Version 18.14 and later
Information in this document applies to any platform.

Symptoms

An application using JDBC and SSL reports the following error when trying to establish a connection to an 18c database:

sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
   at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:456)
   at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:323)
   at sun.security.validator.Validator.validate(Validator.java:271)
   at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:315)
   at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:278)
   at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:141)
   at sun.security.ssl.CertificateMessage$T12CertificateConsumer.checkServerCerts(CertificateMessage.java:632)
   at sun.security.ssl.CertificateMessage$T12CertificateConsumer.onCertificate(CertificateMessage.java:473)
   at sun.security.ssl.CertificateMessage$T12CertificateConsumer.consume(CertificateMessage.java:369)
   at sun.security.ssl.SSLHandshake.consume(SSLHandshake.java:377)
   at sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:444)
   at sun.security.ssl.SSLEngineImpl$DelegatedTask$DelegatedAction.run(SSLEngineImpl.java:968)
   at sun.security.ssl.SSLEngineImpl$DelegatedTask$DelegatedAction.run(SSLEngineImpl.java:955)
   at java.security.AccessController.doPrivileged(Native Method)
   at sun.security.ssl.SSLEngineImpl$DelegatedTask.run(SSLEngineImpl.java:902)
   at oracle.net.nt.SSLSocketChannel.runTasks(SSLSocketChannel.java:644)
   at oracle.net.nt.SSLSocketChannel.doSSLHandshake(SSLSocketChannel.java:436)
   at oracle.net.nt.SSLSocketChannel.write(SSLSocketChannel.java:130)
   at oracle.net.ns.NIOPacket.writeToSocketChannel(NIOPacket.java:355)
   at oracle.net.ns.NIOConnectPacket.writeToSocketChannel(NIOConnectPacket.java:247)
   at oracle.net.ns.NSProtocolNIO.negotiateConnection(NSProtocolNIO.java:127)
   at oracle.net.ns.NSProtocol.connect(NSProtocol.java:347)
   at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1688)
   at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:626)
   at oracle.jdbc.driver.PhysicalConnection.connect(PhysicalConnection.java:813)
   at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:80)
   at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:816)
   at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:620)
   at java.sql.DriverManager.getConnection(DriverManager.java:664)
   at java.sql.DriverManager.getConnection(DriverManager.java:208)
   at JDBCTest.main(JDBCTest.java:35)
  Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
   at sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:141)
   at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:126)
   at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:280)
   at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:451)
   ... 30 more}




Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Cause
Solution
References


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.