gravitee-io / issues

Gravitee.io - API Platform - Issues
64 stars 26 forks source link

MS SqlServer 10.2 onwards driver support #9178

Closed exalate-issue-sync[bot] closed 11 months ago

exalate-issue-sync[bot] commented 1 year ago

MS SqlServer changed encrypt to true by deault in the "mssql-jdbc-10.2.3.jre11.jar" driver and the subsequent releases. As a result user is getting error while trying to upgrade driver from 9x to 12x:

 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:fa6b4700-7975-481b-8f10-2301983dc275

This is not exactly a bug but we need to adapt the change. Adding encrypt=false in the URL fix the issue, such as

Class: AbstractRepositoryConfiguration
 Funciton: initializeDatabaseSchema

final String jdbcUrl = builder.append(SQLSERVER_DRIVER.equals(getDriver()) ? ";databaseName=" : "/").append(poolWrapper.getJdbcDatabase()).append(";encrypt=false").toString();

We may need to add a jdbc yml variable along with the other variables so that MS SqlSever user can set the value of the variable as per their need.

exalate-issue-sync[bot] commented 11 months ago

This issue has been fixed, a new version will be available soon