TLS 1.0 and 1.1 are disabled by default in latest Java versions (OpenJDK 11.0.11 onwards). Because these versions of TLS have weakened over time and lack support for stronger, more modern algorithms.
Solution:
Patch your MSSQL server and enable TLS1.2 on your MSSQL Server as per the Microsoft KB article:
https://support.microsoft.com/en-us/topic/kb3135244-tls-1-2-support-for-microsoft-sql-server-e4472ef8-90a9-13c1-e4d8-44aad198cdbe
Alternate Solutions: (Prone to security risks)
- Enabling them by doing modification in existing java.security file of installed JDK as mentioned in Kevin's answer.
- Or by overriding java.security for your specific application as given below.(preferred)
- Create a file named enableLegacyTLS.security.
- In that file, add an entry for jdk.tls.disabledAlgorithms with the same contents as the jdk.tls.disabledAlgorithms property in the java.security file.
jdk.tls.disabledAlgorithms=SSLv3, TLSv1, TLSv1.1, RC4, DES, MD5withRSA, \
DH keySize < 1024, EC keySize < 224, 3DES_EDE_CBC, anon, NULL,...
Remove TLSv1, TLSv1.1, from the list on the enableLegacyTLS.security.
Start your application with -Djava.security.properties=path/to/enableLegacyTLS.security
Note: In last point, When you use a double equals sign (==), you tell the JVM to ignore the default java.security file and load only this file. But if a single equals sign (=) is used, it loads both your copy and superimposes it over the default java.security file