Shiva Kumar
Shiva Kumar

Reputation: 61

com.microsoft.sqlserver.jdbc.SQLServerException: The driver could not establish a secure connection to SQL Server by using SSL encryption

While running DB connection, getting the below error

com.microsoft.sqlserver.jdbc.SQLServerException: The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: "The server selected protocol version TLS10 is not accepted by client preferences [TLS12]". ClientConnectionId:c85e4cb2-09ee-43f0-b7dc-c6b2e73aee8bUser is able to connect SQL Server successfully!!!

Upvotes: 6

Views: 14247

Answers (2)

Anand Vaidya
Anand Vaidya

Reputation: 1461

It appears that latest update on java11+ has disabled TLSv1 and TLSv1.1

Here is the complete documentation on how to enable it. https://aws.amazon.com/blogs/opensource/tls-1-0-1-1-changes-in-openjdk-and-amazon-corretto/

Appearently I was caught in this issue because of jdk update today, and had hard time finding it. This can help.

Upvotes: 1

Alex
Alex

Reputation: 1639

Your server is using an old TLS version 1.0 and your db driver is refusing to use it. That's because it's old and you should try to configure your server to use latest TLS 1.2. SO has enough entries on how to do this, e.g. https://dba.stackexchange.com/a/276116

Upvotes: 1

Related Questions