← Back to list

sql server连接失败 TLS10 is not accepted

Published on: | Views: 122

sql 连接失败,提示:

The server selected protocol version TLS10 is not accepted by client preferences [TLS13, TLS12]

使用idea连接数据库时,发现提示错误: 驱动程序无法通过使用安全套接字层(SSL)加密与 SQL Server 建立安全连接。错误:“The server selected protocol version TLS10 is not accepted by client preferences [TLS13, TLS12]”。 ClientConnectionId:0165f25b-254d-47bd-a8d2-302c68f10236

大意是说数据库服务器选择了TLS10 但是客户端不支持,要么修改一下服务端协议要么修改下客户端。

搜索后发现是jdk.tls.disabledAlgorithms禁止了不那么安全的协议 搜索jdk中的jdk.tls.disabledAlgorithms: jdk1.8.0_121/jre/lib/security/java.security

jdk.tls.disabledAlgorithms=SSLv3, RC4, MD5withRSA, DH keySize < 768

没有看到禁用TLS1

再次搜索,有人说idea使用了自带的jdk,于是搜索idea目录: idea-IU-213.5744.223/jbr/conf/security/java.security

idea-IU-213.5744.223/jbr/conf/security/java.security:jdk.tls.disabledAlgorithms=SSLv3, TLSv1, TLSv1.1, RC4, DES, MD5withRSA

把 TLSv1, TLSv1.1 都移除掉,重启一下idea或者连接终端, 测试OK