# PoolableConnectionFactory Error

**URL:** <https://forum.inductiveautomation.com/t/poolableconnectionfactory-error/61266>\
**Category:** Ignition\
**Tags:** database\
**Created:** [June 27, 2022, 8:20pm UTC](https://forum.inductiveautomation.com/t/poolableconnectionfactory-error/61266 "2022-06-27T20:20:36Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Christopher\_Benson](https://avatars.discourse-cdn.com/v4/letter/c/839c29/32.png) [@Christopher\_Benson](https://forum.inductiveautomation.com/u/Christopher_Benson)\
**Post date:** [June 27, 2022, 8:20pm UTC](https://forum.inductiveautomation.com/t/poolableconnectionfactory-error/61266/1 "2022-06-27T20:20:36Z")

</div>

Hello all, when I am trying to establish a database connection using MSSQL server. I have been able to connect the database to other Ignition gateways that were (supposedly) set up identically. I have updated the JDBC driver to a version that works on other gateways. Has anyone seen this error before? Thank you.

Error Codes:  
Cannot create PoolableConnectionFactory (The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: “PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target”. ClientConnectionId:35eec8dc-e61a-42b3-86c2-bcab4f87c789)

java.sql.SQLException: Cannot create PoolableConnectionFactory (The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: “PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target”. ClientConnectionId:5087a21c-4c94-41b2-adbe-e4cfa22aaa8a)  
at org.apache.commons.dbcp2.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:656)  
at org.apache.commons.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:534)  
at org.apache.commons.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:734)  
at com.inductiveautomation.ignition.gateway.datasource.DatasourceImpl.getConnectionInternal(DatasourceImpl.java:299)  
at com.inductiveautomation.ignition.gateway.datasource.DatasourceImpl.runTest(DatasourceImpl.java:252)  
at com.inductiveautomation.ignition.gateway.datasource.DatasourceManagerImpl$FaultedDatasourceRetryer.lambda$newRetryRunnable$0(DatasourceManagerImpl.java:1096)  
at com.inductiveautomation.ignition.common.execution.impl.BasicExecutionEngine$TrackedTask.run(BasicExecutionEngine.java:582)  
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)  
at java.base/java.util.concurrent.FutureTask.runAndReset(Unknown Source)  
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)  
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)  
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)  
at java.base/java.lang.Thread.run(Unknown Source)  
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: “PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target”. ClientConnectionId:5087a21c-4c94-41b2-adbe-e4cfa22aaa8a  
at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.java:3680)  
at com.microsoft.sqlserver.jdbc.TDSChannel.enableSSL(IOBuffer.java:2113)  
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:3204)  
at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:2833)  
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectInternal(SQLServerConnection.java:2671)  
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:1640)  
at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:936)  
at org.apache.commons.dbcp2.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:52)  
at org.apache.commons.dbcp2.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:357)  
at org.apache.commons.dbcp2.BasicDataSource.validateConnectionFactory(BasicDataSource.java:103)  
at org.apache.commons.dbcp2.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:652)  
… 12 more  
Caused by: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target  
at java.base/sun.security.ssl.Alert.createSSLException(Unknown Source)  
at java.base/sun.security.ssl.TransportContext.fatal(Unknown Source)  
at java.base/sun.security.ssl.TransportContext.fatal(Unknown Source)  
at java.base/sun.security.ssl.TransportContext.fatal(Unknown Source)  
at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.checkServerCerts(Unknown Source)  
at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.onCertificate(Unknown Source)  
at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.consume(Unknown Source)  
at java.base/sun.security.ssl.SSLHandshake.consume(Unknown Source)  
at java.base/sun.security.ssl.HandshakeContext.dispatch(Unknown Source)  
at java.base/sun.security.ssl.HandshakeContext.dispatch(Unknown Source)  
at java.base/sun.security.ssl.TransportContext.dispatch(Unknown Source)  
at java.base/sun.security.ssl.SSLTransport.decode(Unknown Source)  
at java.base/sun.security.ssl.SSLSocketImpl.decode(Unknown Source)  
at java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(Unknown Source)  
at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)  
at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)  
at com.microsoft.sqlserver.jdbc.TDSChannel.enableSSL(IOBuffer.java:2021)  
… 21 more  
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target  
at java.base/sun.security.validator.PKIXValidator.doBuild(Unknown Source)  
at java.base/sun.security.validator.PKIXValidator.engineValidate(Unknown Source)  
at java.base/sun.security.validator.Validator.validate(Unknown Source)  
at java.base/sun.security.ssl.X509TrustManagerImpl.validate(Unknown Source)  
at java.base/sun.security.ssl.X509TrustManagerImpl.checkTrusted(Unknown Source)  
at java.base/sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown Source)  
at com.microsoft.sqlserver.jdbc.TDSChannel$HostNameOverrideX509TrustManager.checkServerTrusted(IOBuffer.java:1702)  
at java.base/sun.security.ssl.AbstractTrustManagerWrapper.checkServerTrusted(Unknown Source)  
… 34 more  
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target  
at java.base/sun.security.provider.certpath.SunCertPathBuilder.build(Unknown Source)  
at java.base/sun.security.provider.certpath.SunCertPathBuilder.engineBuild(Unknown Source)  
at java.base/java.security.cert.CertPathBuilder.build(Unknown Source)  
… 42 more

8.1.15 (b2022030114)  
Azul Systems, Inc. 11.0.14.1

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [June 27, 2022, 9:06pm UTC](https://forum.inductiveautomation.com/t/poolableconnectionfactory-error/61266/2 "2022-06-27T21:06:36Z")

</div>

> [@Christopher\_Benson](#):
>
> PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

This means your JDBC connection is using SSL/TLS but the server certificate has not been trusted.

If you updated the JDBC driver to 10.1 or later then encryption is now enabled by default. You'll have to either disable it in the connection params or add the server certificate to Ignition's supplemental certificates to be imported.

https://docs.microsoft.com/en-us/sql/connect/jdbc/connecting-with-ssl-encryption?view=sql-server-ver16

https://docs.inductiveautomation.com/display/DOC81/Adding+Security+Certificates+into+KeyStores

---

<div class="post-metadata">

**Author:** ![Christopher\_Benson](https://avatars.discourse-cdn.com/v4/letter/c/839c29/32.png) [@Christopher\_Benson](https://forum.inductiveautomation.com/u/Christopher_Benson)\
**Post date:** [July 15, 2022, 6:01pm UTC](https://forum.inductiveautomation.com/t/poolableconnectionfactory-error/61266/3 "2022-07-15T18:01:09Z")

</div>

Thank you Kevin for your help! I was able to remedy this

---

<div class="post-metadata">

**Author:** ![Lalillo1](https://avatars.discourse-cdn.com/v4/letter/l/a6a055/32.png) [@Lalillo1](https://forum.inductiveautomation.com/u/Lalillo1)\
**Post date:** [November 15, 2022, 6:36pm UTC](https://forum.inductiveautomation.com/t/poolableconnectionfactory-error/61266/4 "2022-11-15T18:36:17Z")

</div>

> [@Kevin.Herron](#):
>
> [https://docs.inductiveautomation.com/display/DOC81/Adding+Security+Certificates+into+KeyStores](https://docs.inductiveautomation.com/display/DOC81/Adding+Security+Certificates+into+KeyStores)

Hi, I actually have installed the 11.2 jdbc driver, but I still get the error even though I have installed a self-signed certificate:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/7/b75eb6c0e0cafd251dfe7fb20a99faeab138aff5.png)

this is the error I get:

Cannot create PoolableConnectionFactory (The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: "PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target". ClientConnectionId:69bf76fa-b0a2-4448-95fc-0f5188600923)

Copy

java.sql.SQLException: Cannot create PoolableConnectionFactory (The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: "PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target". ClientConnectionId:90bfbda6-a3d4-47b5-b50b-cc5d8c555752) at org.apache.commons.dbcp2.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:656) at org.apache.commons.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:534) at org.apache.commons.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:734) at com.inductiveautomation.ignition.gateway.datasource.DatasourceImpl.getConnectionInternal(DatasourceImpl.java:300) at com.inductiveautomation.ignition.gateway.datasource.DatasourceImpl.runTest(DatasourceImpl.java:253) at com.inductiveautomation.ignition.gateway.datasource.DatasourceManagerImpl$FaultedDatasourceRetryer.lambda$newRetryRunnable$0(DatasourceManagerImpl.java:1096) at com.inductiveautomation.ignition.common.execution.impl.BasicExecutionEngine$TrackedTask.run(BasicExecutionEngine.java:587) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.base/java.util.concurrent.FutureTask.runAndReset(Unknown Source) at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.base/java.lang.Thread.run(Unknown Source) Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: "PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target". ClientConnectionId:90bfbda6-a3d4-47b5-b50b-cc5d8c555752 at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.java:3806) at com.microsoft.sqlserver.jdbc.TDSChannel.enableSSL(IOBuffer.java:1906) at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:3329) at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:2950) at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectInternal(SQLServerConnection.java:2790) at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:1663) at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:1064) at org.apache.commons.dbcp2.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:52) at org.apache.commons.dbcp2.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:357) at org.apache.commons.dbcp2.BasicDataSource.validateConnectionFactory(BasicDataSource.java:103) at org.apache.commons.dbcp2.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:652) ... 12 more Caused by: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target at java.base/sun.security.ssl.Alert.createSSLException(Unknown Source) at java.base/sun.security.ssl.TransportContext.fatal(Unknown Source) at java.base/sun.security.ssl.TransportContext.fatal(Unknown Source) at java.base/sun.security.ssl.TransportContext.fatal(Unknown Source) at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.checkServerCerts(Unknown Source) at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.onCertificate(Unknown Source) at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.consume(Unknown Source) at java.base/sun.security.ssl.SSLHandshake.consume(Unknown Source) at java.base/sun.security.ssl.HandshakeContext.dispatch(Unknown Source) at java.base/sun.security.ssl.HandshakeContext.dispatch(Unknown Source) at java.base/sun.security.ssl.TransportContext.dispatch(Unknown Source) at java.base/sun.security.ssl.SSLTransport.decode(Unknown Source) at java.base/sun.security.ssl.SSLSocketImpl.decode(Unknown Source) at java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(Unknown Source) at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source) at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source) at com.microsoft.sqlserver.jdbc.TDSChannel.enableSSL(IOBuffer.java:1795) ... 21 more Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target at java.base/sun.security.validator.PKIXValidator.doBuild(Unknown Source) at java.base/sun.security.validator.PKIXValidator.engineValidate(Unknown Source) at java.base/sun.security.validator.Validator.validate(Unknown Source) at java.base/sun.security.ssl.X509TrustManagerImpl.validate(Unknown Source) at java.base/sun.security.ssl.X509TrustManagerImpl.checkTrusted(Unknown Source) at java.base/sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown Source) at com.microsoft.sqlserver.jdbc.HostNameOverrideX509TrustManager.checkServerTrusted(SQLServerTrustManager.java:86) at java.base/sun.security.ssl.AbstractTrustManagerWrapper.checkServerTrusted(Unknown Source) ... 34 more Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target at java.base/sun.security.provider.certpath.SunCertPathBuilder.build(Unknown Source) at java.base/sun.security.provider.certpath.SunCertPathBuilder.engineBuild(Unknown Source) at java.base/java.security.cert.CertPathBuilder.build(Unknown Source) ... 42 more

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [November 15, 2022, 6:45pm UTC](https://forum.inductiveautomation.com/t/poolableconnectionfactory-error/61266/5 "2022-11-15T18:45:57Z")

</div>

You're showing me a configuration page for setting up SSL/TLS on the Ignition web server, and that's entirely irrelevant to what's going on here.

The SQL Server instance your connecting to has its own certificate and right now Ignition does not trust it. You need a copy of _that_ certificate to [add to Ignition](https://docs.inductiveautomation.com/display/DOC81/Security+Certificates#SecurityCertificates-AddingSecurityCertificatesintoKeyStores).

Or you need to disable encryption all together by adding `encrypt=false` to the other parameters in the JDBC connection string.

---

<div class="post-metadata">

**Author:** ![Lalillo1](https://avatars.discourse-cdn.com/v4/letter/l/a6a055/32.png) [@Lalillo1](https://forum.inductiveautomation.com/u/Lalillo1)\
**Post date:** [November 15, 2022, 7:09pm UTC](https://forum.inductiveautomation.com/t/poolableconnectionfactory-error/61266/7 "2022-11-15T19:09:16Z")

</div>

> [@Kevin.Herron](#):
>
> encrypt=false

Never mind: I got it. It was here:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/3/23f4d47b0126d815c5e2a355e4548008e0ea4a4e.png)

Thank you very much for your help!

---

<div class="post-metadata">

**Author:** ![p.srikanth0707](https://avatars.discourse-cdn.com/v4/letter/p/e47774/32.png) [@p.srikanth0707](https://forum.inductiveautomation.com/u/p.srikanth0707)\
**Post date:** [May 9, 2023, 12:58pm UTC](https://forum.inductiveautomation.com/t/poolableconnectionfactory-error/61266/8 "2023-05-09T12:58:40Z")

</div>

It is not working for me. facing the same issue.

Error Message ::

Cannot create PoolableConnectionFactory (The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: "No appropriate protocol (protocol is disabled or cipher suites are inappropriate)".)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/c/bc19c46955bffa5f868166f5b111941442ecc46f.png)

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [October 8, 2024, 7:12pm UTC](https://forum.inductiveautomation.com/t/poolableconnectionfactory-error/61266/9 "2024-10-08T19:12:43Z")

</div>

Split this topic on October 8, 2024, 7:12pm UTC

A post was split to a new topic: [SQLServer PoolableConnectionFactory Login failed](https://forum.inductiveautomation.com/t/sqlserver-poolableconnectionfactory-login-failed/96989)

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [October 8, 2024, 7:12pm UTC](https://forum.inductiveautomation.com/t/poolableconnectionfactory-error/61266/10 "2024-10-08T19:12:50Z")

</div>

Closed on October 8, 2024, 7:12pm UTC


