我已经在我的 Ubuntu 20.04 最小版上安装了 Sql Server 2019 Developer Edition 和 mssql-tools。
我可以毫无问题地连接到我的本地主机,但是当我想远程到另一个 sql 服务器时:
sqlcmd -S <server> -U <username> -P <password>
我面临这个错误:Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : SSL Provider: [error:1425F102:SSL routines:ssl_choose_client_version:unsupported protocol].
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Client unable to establish connection.
我在 Debian 10 中遇到过这个问题,并且还在网上搜索解决方案,所以之后我更改了我的 openssl.conf
手动(需要su权限):nano /etc/ssl/openssl.cnf
并将这些添加到我的文件中:ess_cert_id_alg = sha1
下[tsa_config1]
标题openssl_conf = default_conf
靠近顶部[default_conf]
ssl_conf = ssl_sect
[ssl_sect]
system_default = system_default_sect
[system_default_sect]
MinProtocol = TLSv1.0
CipherString = 默认@SECLEVEL=1
我知道
MinProtocol
和 CipherString
通常设置为 TLSv1.2
和 DEFAULT@SECLEVEL=2
,但正如我在 Debian 10 中提到的,我编辑了我的 openssl.conf 并更改了 TLSv1.2
至TLSv1.0
和 DEFAULT@SECLEVEL=2
至DEFAULT@SECLEVEL=1
并且我的连接已修复,但在 Ubuntu 20.04 minimum 中不仅没有这些行,而且当我再次手动插入这些行时,我面临同样的错误:Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : SSL Provider: [error:1425F102:SSL routines:ssl_choose_client_version:unsupported protocol].
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Client unable to establish connection.
我的 opnessl 版本是:OpenSSL 1.1.1f 31 Mar 2020
我还将我的 openssl 降级一次到 1.0,但它也没有工作!我找不到其他任何东西,所以我来这里寻求帮助,感谢您的帮助。
最佳答案
1.1.1m 救了我的命。手动安装。
手动安装如下所示:
wget https://www.openssl.org/source/latest.tar.gz -O openssl-1.1.1h.tar.gz
tar -zxvf openssl-1.1.1m.tar.gz
cd openssl-1.1.1m
./config
make
sudo make install
openssl version
sudo ldconfig
关于sql-server - 如何修复 Microsoft ODBC Driver 17 for SQL Server : SSL Provider ssl_choose_client_version:unsupported protocol,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64412165/