netcore 连接sql server 2014 ubuntu20.04踩坑-SSL_connect: error:1425F102 .. unsupported protocol

第一次往上 liunx上部署netcore  服务,数据库采用了sql server 2014 在运行服务时候无法启动遇到了错误

ERROR 2026 (HY000): SSL connection error: error:1425F102:SSL routines:ssl_choose_client_version:unsupported protocol

问题的原因是ubuntu20.04将openssl 连接时,可接纳的ssl协议版本提高了,之前的版本不存在此问题

导致与对方建立ssl连接时,如果对方使用的不是TLSv1.2及以上,就会产生异常,提示不支持的协议.

 

解决方法是:

修改  /etc/ssl/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.1
CipherString = DEFAULT@SECLEVEL=1

 

seclevel=2 则必须使用 TLSv1.2  
这个可以在ubuntu20.04 openssl 的changelog中看到 

同时,同时给sql server 服务器打上  SQL Server 2014 Service Pack 1 (SP1)  补丁,否则依然会报告这个错误

补丁地址:https://support.microsoft.com/zh-tw/help/2936603/sql-server-2014-build-versions  

自己搜索也可以

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章