'Is there anyway to connect to Azure SQL Server using jTDS with TLS 1.2?
Our Java app use jTDS 1.3.1 to connect to SQL Server, which works fine until a client trying to put the database on Azure SQL. The connection failed with the following exception:
java.sql.SQLException: Reason: Login failed due to client TLS version being less than minimal TLS version allowed by the server.
I checked the documentation of jTDS, can't see anyway to specify TLS version. Besides replacing it with MS JDBC driver, has anyone succeeded with other work around?
I don't have access to Azure SQL, so I cannot test if reducing the TLS version to 1.0 would work.
Solution 1:[1]
Solved the issue by chance. Just need to append ";ssl=request" to the connection string. It looks like by default SSL/TLS is disabled. The error message about TLS version is misleading. Hope this help someone in the future.
Solution 2:[2]
Had this same issue when trying to connect a .Net application to a Azure SQL database in Azure managed instance.
Here's how I solved it:
My previous JDBC URL was this:
jdbc:jtds:sqlserver://my-example-instance.c656df8582985.database.windows.net:1433
I just added ssl=require to the end of the URL, so it became:
jdbc:jtds:sqlserver://my-example-instance.c656df8582985.database.windows.net:1433;ssl=require
That's all.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | user2552742 |
| Solution 2 | Promise Preston |
