Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Driver cannot connect to the MSSQL server after migrating to Java 17 #5065

Closed
sahanHe opened this issue Oct 20, 2023 · 2 comments · Fixed by ballerina-platform/module-ballerinax-mssql#769

Comments

@sahanHe
Copy link

sahanHe commented Oct 20, 2023

Description:
Currently when tried to connect to the the MSSQL databased using module-ballerina-mssql, it fails with the following error

error: Error in SQL connector configuration: Failed to initialize pool: The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: "PKIX path building failed: unable to find valid certification path to requested target". ClientConnectionId:4036508b-8f55-4fa6-bbf4-743389988323 Caused by :The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. 

this started after updating to mssql driver version 10.2 - release note

Affected Versions:
module-ballerina-mssql.driver : 1.6.0

@sahanHe sahanHe changed the title Driver cannot connect to the MSSQL server after migrating to JAVA 17 Driver cannot connect to the MSSQL server after migrating to Java 17 Oct 20, 2023
@kaneeldias
Copy link
Contributor

This is due to the later mssql jdbc driver we are using (10.2)

According to the release note, the following breaking changes were made

  • BREAKING CHANGE - Default Encrypt to true
  • BREAKING CHANGE - Changed certificate validation behavior to validate when encryption is negotiated from either the client or the server

Now the default values for the connection properties encrypt and trustServerCertificate is set to true and false respectively. Which was not the behaviours we expected when using the older drivers

@github-actions
Copy link

This issue is NOT closed with a proper Reason/ label. Make sure to add proper reason label before closing. Please add or leave a comment with the proper reason label now.

      - Reason/EngineeringMistake - The issue occurred due to a mistake made in the past.
      - Reason/Regression - The issue has introduced a regression.
      - Reason/MultipleComponentInteraction - Issue occured due to interactions in multiple components.
      - Reason/Complex - Issue occurred due to complex scenario.
      - Reason/Invalid - Issue is invalid.
      - Reason/Other - None of the above cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants