PKIX path building failed - Connection to DB server failed

Questions and answers for all installation-related topics for Servoy products

PKIX path building failed - Connection to DB server failed

Postby kwpsd » Thu Nov 16, 2023 1:55 am

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?
Kim W. Premuda
San Diego, CA USA
User avatar
kwpsd
 
Posts: 687
Joined: Sat Jul 28, 2007 6:59 pm
Location: San Diego, CA USA

Re: PKIX path building failed - Connection to DB server fail

Postby maneffa » Fri Nov 17, 2023 11:32 am

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
maneffa
 
Posts: 2
Joined: Fri Nov 10, 2023 2:27 pm

Re: PKIX path building failed - Connection to DB server fail

Postby kwpsd » Fri Nov 17, 2023 11:12 pm

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)
Kim W. Premuda
San Diego, CA USA
User avatar
kwpsd
 
Posts: 687
Joined: Sat Jul 28, 2007 6:59 pm
Location: San Diego, CA USA

Re: PKIX path building failed - Connection to DB server fail

Postby maneffa » Mon Nov 20, 2023 10:26 am

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
maneffa
 
Posts: 2
Joined: Fri Nov 10, 2023 2:27 pm

Re: PKIX path building failed - Connection to DB server fail

Postby kwpsd » Wed Nov 22, 2023 12:30 am

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

I really appreciate your help with this issue...thanks so much!
Kim W. Premuda
San Diego, CA USA
User avatar
kwpsd
 
Posts: 687
Joined: Sat Jul 28, 2007 6:59 pm
Location: San Diego, CA USA


Return to Installation

Who is online

Users browsing this forum: No registered users and 10 guests