Can't connect to SQL Server from Jetbrains Rider after updating driver to 10.2
Asked Answered
L

5

6

I'm using the same credentials as before update. It writes:

[08S01] 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:ebe9ba87-4c34-4015-b6c8-a151bdf33a67 unable to find valid certification path to requested target

Lavaliere answered 28/4, 2022 at 14:19 Comment(2)
I don't remember where but it happened to me once when it said no data source was configured for the SQL I wrote. When I went in to configure the data source and updated the driver for SQL server to latest, I had that problem. Replacing the driver with an older one (9.x?) solved the problem. In another project that I am working on now (Rider 2022.1) I could directly go and add an SQL server with no problems: DBMS: Microsoft SQL Server (ver. 15.00.2080) Case sensitivity: plain=mixed, delimited=mixed Driver: JetBrains JDBC Driver for SQL Server (ver. 1.0, JDBC4.2) Ping: 78 ms SSL: noKraemer
Your SQL Server is providing either a self-cerified certificate or a certificate which is not trusted by the client. You need to give it a certificate which will be trustedSwaddle
K
4

(Adding here because didn't fit in comments) I don't remember where but it happened to me once when it said no data source was configured for the SQL I wrote. When I went in to configure the data source and updated the driver for SQL server to latest, I had that problem. Replacing the driver with an older one (9.x?) solved the problem. In another project that I am working on now (Rider 2022.1) I could directly go and add an SQL server with no problems (used windows authentication):

DBMS: Microsoft SQL Server (ver. 15.00.2080)
Case sensitivity: plain=mixed, delimited=mixed
Driver: JetBrains JDBC Driver for SQL Server (ver. 1.0, JDBC4.2)
Ping: 78 ms 
SSL: no
Kraemer answered 28/4, 2022 at 14:40 Comment(0)
L
11

Adding Encrypt=false to the JDBC string disables the secure protocol and bypasses the certificate problem.

Liana answered 9/5, 2022 at 14:36 Comment(1)
Better to encrypt and use the server certificate than turn off encryption entirely.Gradin
G
5

Version 10.2 changed the default value of "encrypt" to "true" where previously it was "false".

You have three options: install a certificate, use the server's self-signed certificate, or turn encryption off again. The first option is the most secure.

To use the self-signed certificate, open the connection properties, go to the Advanced tab, and set "trustServerCertificate" to "true":

screenshot of data source advanced settings tab (Screenshot from DataGrip, but it should look the same in Rider.)

Gradin answered 30/8, 2023 at 12:38 Comment(0)
K
4

(Adding here because didn't fit in comments) I don't remember where but it happened to me once when it said no data source was configured for the SQL I wrote. When I went in to configure the data source and updated the driver for SQL server to latest, I had that problem. Replacing the driver with an older one (9.x?) solved the problem. In another project that I am working on now (Rider 2022.1) I could directly go and add an SQL server with no problems (used windows authentication):

DBMS: Microsoft SQL Server (ver. 15.00.2080)
Case sensitivity: plain=mixed, delimited=mixed
Driver: JetBrains JDBC Driver for SQL Server (ver. 1.0, JDBC4.2)
Ping: 78 ms 
SSL: no
Kraemer answered 28/4, 2022 at 14:40 Comment(0)
F
0

In Rider 2022.1 we have implemented JDBC SQL Driver which is able to connect to MS SQL Server in a better way then a default (microsoft) one using named pipes and any kind of authentication. You can use .net connection strings there.

It should work find out of the box. If something does not work please fire an issue in JetBrains public issue tracker:

https://youtrack.jetbrains.com/newIssue?project=RIDER

Foundry answered 28/4, 2022 at 18:49 Comment(0)
L
0

I was facing the same problem and the error was happening because I had to trust the server certificate manually by configuring it in order to skip the validation of the server certificate.

To configure trust certification server you have to select Advanced (on the left of the General page where you are configuring the DB properties) and find on the drop-down the field trustServerCertificate and make that true.

Check image below:

enter image description here

Lcm answered 13/3, 2024 at 13:35 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.