cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption

Hardy
New Contributor III

I am trying to connect to SQL through JDBC from databricks notebook. (Below is my notebook command)

val df = spark.read.jdbc(jdbcUrl, "[MyTableName]", connectionProperties)
println(df.schema)

When I execute this command,

with DBR 10.4 LTS it works fine. But after upgrading to DBR 13.0 it throws below error:

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:XXXXXXXX-XXXXX-XXXXX-XXXXX-XXXXXXXXXXXX

Caused by: SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

Caused by: ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

Caused by: SunCertPathBuilderException: unable to find valid certification path to requested target

5 REPLIES 5

Anonymous
Not applicable

Hi @Hardy S​ 

Great to meet you, and thanks for your question!

Let's see if your peers in the community have an answer to your question. Thanks.

DBXC
Contributor

Anyone has update on this? I am seeing the same issue with DBR 12.2

Mielios
New Contributor II

Also seeing this issue after upgrading to DBR 12.2. Any news is very much appreciated!

DBXC
Contributor
Try to add the following parameters to your SQL connection string. It fixed my problem for 13.X and 12.X
;trustServerCertificate=true;hostNameInCertificate=*.database.windows.net;
 

Yep, that does it.

Join 100K+ Data Experts: Register Now & Grow with Us!

Excited to expand your horizons with us? Click here to Register and begin your journey to success!

Already a member? Login and join your local regional user group! If there isn’t one near you, fill out this form and we’ll create one for you to join!