# PKIX path building failed - Connection to DB server failed

**URL:** <https://forum.servoy.com/t/pkix-path-building-failed-connection-to-db-server-failed/21110>\
**Category:** Questions\
**Created:** [November 15, 2023, 11:55pm UTC](https://forum.servoy.com/t/pkix-path-building-failed-connection-to-db-server-failed/21110 "2023-11-15T23:55:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kwpsd](https://avatars.discourse-cdn.com/v4/letter/k/bb73d2/32.png) [@kwpsd](https://forum.servoy.com/u/kwpsd)\
**Post date:** [November 15, 2023, 11:55pm UTC](https://forum.servoy.com/t/pkix-path-building-failed-connection-to-db-server-failed/21110/1 "2023-11-15T23:55:08Z")

</div>

I downloaded version **2023.9.1** from the Servoy Cloud, installed it, and created a new workspace, however, Servoy will not connect to any of the MS-SQL back-end tables. The following is displayed…

> Connection to DB server could not be established using this configuration
> 
> 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”.  
> ClientConnectionld:173b08c2-58f7-4e3b-bf18-c8ca52cbc871

Version **2023.6.x** works fine with our MS-SQL tables. Does anyone know what the SSL failure mechanism is? How do I fix this?

---

<div class="post-metadata">

**Author:** ![maneffa](https://avatars.discourse-cdn.com/v4/letter/m/c2a13f/32.png) [@maneffa](https://forum.servoy.com/u/maneffa)\
**Post date:** [November 17, 2023, 9:32am UTC](https://forum.servoy.com/t/pkix-path-building-failed-connection-to-db-server-failed/21110/2 "2023-11-17T09:32:53Z")

</div>

Change your database server connection string in the advanced option and add TrustServerCertificate=true

Warning - this reduces the security of your connection (too complex to discuss here)

jdbc:sqlserver://YOURSERVERNAME:1433;DatabaseName=YOURDATABASENAME;SelectMethod=direct;sendTimeAsDateTime=false;TrustServerCertificate=true

---

<div class="post-metadata">

**Author:** ![kwpsd](https://avatars.discourse-cdn.com/v4/letter/k/bb73d2/32.png) [@kwpsd](https://forum.servoy.com/u/kwpsd)\
**Post date:** [November 17, 2023, 9:12pm UTC](https://forum.servoy.com/t/pkix-path-building-failed-connection-to-db-server-failed/21110/3 "2023-11-17T21:12:11Z")

</div>

Thank you…that string modification worked! Much appreciated!

May I inquire where you found this fix? Was it in the Servoy documentation (wiki)? (I could not find it)

---

<div class="post-metadata">

**Author:** ![maneffa](https://avatars.discourse-cdn.com/v4/letter/m/c2a13f/32.png) [@maneffa](https://forum.servoy.com/u/maneffa)\
**Post date:** [November 20, 2023, 8:26am UTC](https://forum.servoy.com/t/pkix-path-building-failed-connection-to-db-server-failed/21110/4 "2023-11-20T08:26:53Z")

</div>

I did not find the answer in the wiki. Interestingly, I did not think to look in the wiki as I am new to Servoy but 25 years with SQL server and would historically look around database info for such an answer.

I have seen this behaviour on SQL Server server connections recently (eg SSMS has a checkbox to TrustServerCertificate) as default security has been tightened to now require a valid certificate chain as default behaviour instead of the default being to not require a valid certificate chain.

Whether the change is due to a newer jdbc being bundled or Servoy changing their internal connection I don’t know. The Servoy release notes do state:  
Eclipse updated to 2023.06 (4.28) Shipped java updated to 17.08 A lot of jdbc drivers are updated to the latest releases (mssql, mysql, postgresql and hsqldb (inmem)) A lot of 3rd party jars (core and plugin jars) are updated like snake, jandex, jackons and jwt libs.

I currently have 12.2.0 mssql driver on Servoy 2023.9.1

Hope this helps

---

<div class="post-metadata">

**Author:** ![kwpsd](https://avatars.discourse-cdn.com/v4/letter/k/bb73d2/32.png) [@kwpsd](https://forum.servoy.com/u/kwpsd)\
**Post date:** [November 21, 2023, 10:30pm UTC](https://forum.servoy.com/t/pkix-path-building-failed-connection-to-db-server-failed/21110/5 "2023-11-21T22:30:26Z")

</div>

Welcome to the forum!

After some research, I learned that Microsoft tightened connection security since version 10.2 of their JDBC driver which caused this BREAKING CHANGE. Here is a link to the Microsoft article, if interested…

[https://techcommunity.microsoft.com/t5/sql-server-blog/jdbc-driver-10-2-for-sql-server-released/ba-p/3100754](https://techcommunity.microsoft.com/t5/sql-server-blog/jdbc-driver-10-2-for-sql-server-released/ba-p/3100754)

I really appreciate your help with this issue…thanks so much!
