CentOS 连接SqlServer (provide:SSL Provider,error:31 - Encryption(ssl/tls) handshake failed)

环境

  • 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

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容