linux sqlserver数据库连接问题-The server selected protocol version TLS10 is not accepted by client preferences[TLS12]

linux sqlserver数据库连接问题

异常提示:
The server selected protocol version TLS10 is not accepted by client preferences[TLS12]

  • 问题原因:

客户端引用的协议版本是TLS12,但是服务端协议版本是10.简单说就是数据库版本太低,需要降低客户端版本才能适配

解决方式:

  • 查询java.security文件
    locate java.security

  • 更新java.security文件

去除java.security文件中jdk.tls.disabledAlgorithms 禁用TLS1.*算法配置,这样客户端就可以适配低版本协议

java.security 文件最终配置:

# Note: This property is currently used by the JDK Reference implementation.
# It is not guaranteed to be examined and used by other implementations.
#
# Example:
#   jdk.tls.disabledAlgorithms=MD5, SSLv3, DSA, RSA keySize < 2048
jdk.tls.disabledAlgorithms=SSLv3, RC4, DES, MD5withRSA, \
    DH keySize < 1024, EC keySize < 224, 3DES_EDE_CBC, anon, NULL, \
    include jdk.disabled.namedCurves

扩展内容

locate命令用于查找文件, 它比find命令的搜索速度快, 它需要一个数据库.这里是centos的配置流程

  • 安装locate命令
    yum -y install mlocate
  • 生成数据库
    updatedb

参考资料

The server selected protocol version TLS10 is not accepted by client preferences [TLS12] 报错处理

posted @ 2022-07-04 18:29  橙木鱼  阅读(6541)  评论(0编辑  收藏  举报