Reputation: 764
I am trying to connect to a SQL Server from local with pyspark. I've downloaded the last driver version, but when running the code below this error shows:
Error: "The server selected protocol version TLS10 is not accepted by client preferences [TLS12]"
The code is as following (Spark session was initiated before and the driver is located in a supported path):
jdbcDF = spark.read \
.format("jdbc") \
.option("url","jdbc:sqlserver://<host>\\<port>;database=<database>;") \
.option("dbtable", <table>) \
.option("user", <username>) \
.option("password", <password>) \
.option("driver", "com.microsoft.sqlserver.jdbc.SQLServerDriver") \
.load()
I read that one possible solution would be to change some configuration from the SQL Server, but this is not possible for me. Is there any way of fixing it without changing anything in the SQL Server?
Upvotes: 0
Views: 479
Reputation: 136
I think your question is similar to this one
From the above link:
TLS10 is disabled in Java 1.8 and above. You can enable it by remove TLSv1
from jdk.tls.disabledAlgorithms
in the java.security
file (This edit is done in your client machine, not SQL Server).
This worked in my case.
Upvotes: 2