今天java项目连接sql server突然连接不上了,报如下错误:
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:13635d11-338f-44e3-933b-2eb635771c43
at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.java:2435)
at com.microsoft.sqlserver.jdbc.TDSChannel.enableSSL(IOBuffer.java:1816)
.....
最终发现原因是JDK自动升级导致的,较高版本的JDK对安全性提升,服务端的数据库TLS版本过低导致。回滚JDK版本解决。