SQL 服务器连接失败 Linux Mint + SQL Server 2008 R2 使用 AzureDataStudio

SQL Server Connection Failed with Linux Mint + SQL Server 2008 R2 using AzureDataStudio

我正在尝试使用 SP4 数据库连接到我的 SQL Server 2008 R2,但是,我遇到了这个错误,我尝试了一些我在这里找到的解决方案,但是 none 对我有用.

PS。我不知道如何理解这个错误

Microsoft.Data.SqlClient.SqlException (0x80131904): A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: TCP Provider, error: 35 - An internal exception was caught)

System.Security.Authentication.AuthenticationException: Authentication failed, see inner exception.

Interop+OpenSsl+SslException: SSL Handshake failed with OpenSSL error - SSL_ERROR_SSL.

Interop+Crypto+OpenSslCryptographicException: error:1425F102:SSL routines:ssl_choose_client_version:unsupported protocol

我知道错误是:

SSL Handshake failed with OpenSSL error

我的 openssl 版本:

OpenSSL 1.1.1f  31 Mar 2020
built on: Mon Apr 20 11:53:50 2020 UTC
platform: debian-amd64
options:  bn(64,64) rc4(16x,int) des(int) blowfish(ptr) 
compiler: gcc -fPIC -pthread -m64 -Wa,--noexecstack -Wall -Wa,--noexecstack -g -O2 -fdebug-prefix-map=/build/openssl-P_ODHM/openssl-1.1.1f=. -fstack-protector-strong -Wformat -Werror=format-security -DOPENSSL_TLS_SECURITY_LEVEL=2 -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DRC4_ASM -DMD5_ASM -DAESNI_ASM -DVPAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -DX25519_ASM -DPOLY1305_ASM -DNDEBUG -Wdate-time -D_FORTIFY_SOURCE=2
OPENSSLDIR: "/usr/lib/ssl"
ENGINESDIR: "/usr/lib/x86_64-linux-gnu/engines-1.1"
Seeding source: os-specific

我也试过改变我的 openssl.cnf:

  1. 在开头加上这一行

     openssl_conf = default_conf
    
  2. 在末尾添加这些行

     [ default_conf ]
     ssl_conf = ssl_sect
     [ssl_sect]
     system_default = ssl_default_sect
    
     [ssl_default_sect]
     MinProtocol = TLSv1.2
     CipherString = DEFAULT:@SECLEVEL=1
    

但我仍然收到此错误。

PS:我正在使用 Azure Data Studio

谢谢大家,谁遇到了同样的问题: 我只是将 SSL 降级到 1.1.1 并且它可以工作。

SQL server 2008 r2 SP3 应该支持1.1.1g或1.1.1f。

以下是要遵循的说明:

  1. 打开终端 (Ctrl+Alt+t)。
  2. 获取压缩包:wget https://www.openssl.org/source/openssl-1.1.1.tar.gz
  3. 使用 tar -zxf openssl-1.1.1.tar.gz && cd openssl-1.1.1
  4. 解压缩 tarball
  5. 发出命令./config
  6. sudo apt install make gcc
  7. make
  8. make test 检查可能的错误。
  9. 备份当前 openssl 二进制文件:sudo mv /usr/bin/openssl ~/tmp
  10. 发出命令sudo make install
  11. sudo ln -s /usr/local/bin/openssl /usr/bin/openssl
  12. 运行 命令 sudo ldconfig 更新符号链接并重建库缓存。

假设在执行步骤 4 到 10 时没有错误,您应该已经成功安装了新版本的 OpenSSL。

再次从终端发出命令:

openssl version

您的输出应如下所示:

OpenSSL 1.1.1  11 Sep 2018

来源(dif openssl 版本但方法相同)

https://askubuntu.com/questions/1102803/how-to-upgrade-openssl-1-1-0-to-1-1-1-in-ubuntu-18-04