美文网首页
CentOS 连接SqlServer (provide:SSL

CentOS 连接SqlServer (provide:SSL

作者: Paulo21 | 来源:发表于2022-07-18 10:01 被阅读0次

环境

  • CentOS 7
  • .Net 6
  • Sqlsugar

错误

SqlServer:
Connection open error . A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: SSL Provider, error: 31 - Encryption(ssl/tls) handshake failed)
MySql:
Connection open error . Authentication failed, see inner exception.

解决方案

vim /etc/pki/tls/openssl.cnf

#在oid_section=new_oids下增加
openssl_conf = default_conf
#在文件末尾增加
[default_conf]
ssl_conf = ssl_sect
[ssl_sect]
system_default = system_default_sect
[system_default_sect]
MinProtocol = TLSv1
CipherString = DEFAULT@SECLEVEL=1

#重启sshd
sudo systemctl restart sshd

原因分析

不成熟的原因分析:
服务器使用的ssl为TLS1_2版本,而数据库连接需要的版本为TLSv1
参考
https://cloud.tencent.com/developer/article/1816990

相关文章

网友评论

      本文标题:CentOS 连接SqlServer (provide:SSL

      本文链接:https://www.haomeiwen.com/subject/peirirtx.html