Hello Toan Nguyenngoc!
When upgrading from JDK 1.6.0 to OpenJDK 8u422 and encountering the error:
“om.microsoft.sqlserver.jdbc.TDSChannel enableSSL WARNING: TDSChannel ( ConnectionID:1 TransactionID:0x0000000000000000) SSL handshake failed: No appropriate protocol (protocol is disabled or cipher suites are inappropriate)”
This is a common SSL/TLS compatibility issue that happens for the following reasons:
JDK 8 disables older protocols and weak cipher suites by default for security.
The SQL Server or the JDBC driver might only support legacy SSL/TLS versions, or the Java security settings may block required protocols.
How to fix it:
Check SQL Server SSL/TLS support: Make sure your SQL Server is configured to support TLS 1.2 (recommended for Java 8+) or at least TLS 1.0/1.1 if necessary.
Update the JDBC driver: Use the latest Microsoft SQL Server JDBC driver compatible with your Java and SQL Server version. Older drivers may not support modern TLS, causing handshake errors.
Adjust Java Security Settings (if absolutely needed):
In your Java installation directory, open the file: java.security
Find the line **`jdk.tls.disabledAlgorithms`**
If required, temporarily comment it out or modify it to enable the required algorithm, though this is not recommended for production since it weakens security.
**Explicitly Enable Protocols:** You can specify which TLS versions Java should use by setting a system property, e.g.:
```sql
text
-Dhttps.protocols=TLSv1.2,TLSv1.1,TLSv1
```
Add this to your Eclipse VM/runtime arguments, or in application startup.
**Update SQL Server:** If possible, update your SQL Server and its configuration so that it supports newer, more secure protocols (like TLS 1.2).
The root cause is usually a mismatch between the supported SSL/TLS protocols and cipher suites between your Java runtime and the database server. Ensure both are up to date, and if changes to security properties are made, revert them when possible for best security.
Best Regards,
Jerald Felix