Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable SQL Server JDBC SSL Encryption (in 10.2 driver version and onwards)

Since 10.2, SQL Server enables SSL by default, which is a breaking change by their own admission:

https://learn.microsoft.com/en-us/sql/connect/jdbc/release-notes-for-the-jdbc-driver?view=sql-server-ver16#changes-in-102

Now, the question is how to adapt an existing, good/working JDBC connection string to not use encryption. E.g. what should this URL become?

jdbc:sqlserver://localhost:1433;databaseName=SomeDatabase;
like image 944
Dave Ankin Avatar asked Nov 28 '25 16:11

Dave Ankin


2 Answers

Seems to be just add encrypt=false; to the end, and the app starts up again.

like image 169
Dave Ankin Avatar answered Dec 01 '25 10:12

Dave Ankin


Important to know: encrypt=false does NOT disable encryption, it just indicates that it's not required by the client. If it's set to false, and the server requires encryption, then the connection will be encrypted, but the server certificate will not be verified.

like image 36
Max Tardiveau Avatar answered Dec 01 '25 11:12

Max Tardiveau