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
:
在开头加上这一行
openssl_conf = default_conf
在末尾添加这些行
[ 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。
以下是要遵循的说明:
- 打开终端 (Ctrl+Alt+t)。
- 获取压缩包:
wget https://www.openssl.org/source/openssl-1.1.1.tar.gz
- 使用
tar -zxf openssl-1.1.1.tar.gz && cd openssl-1.1.1
解压缩 tarball
- 发出命令
./config
。
sudo apt install make gcc
make
make test
检查可能的错误。
- 备份当前 openssl 二进制文件:
sudo mv /usr/bin/openssl ~/tmp
- 发出命令
sudo make install
。
sudo ln -s /usr/local/bin/openssl /usr/bin/openssl
- 运行 命令
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
我正在尝试使用 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
:
在开头加上这一行
openssl_conf = default_conf
在末尾添加这些行
[ 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。
以下是要遵循的说明:
- 打开终端 (Ctrl+Alt+t)。
- 获取压缩包:
wget https://www.openssl.org/source/openssl-1.1.1.tar.gz
- 使用
tar -zxf openssl-1.1.1.tar.gz && cd openssl-1.1.1
解压缩 tarball
- 发出命令
./config
。 sudo apt install make gcc
make
make test
检查可能的错误。- 备份当前 openssl 二进制文件:
sudo mv /usr/bin/openssl ~/tmp
- 发出命令
sudo make install
。 sudo ln -s /usr/local/bin/openssl /usr/bin/openssl
- 运行 命令
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