从 Raspberry Pi 连接到 SQL 服务器导致错误 35(在登录前握手期间)
Connecting to SQL Server from Raspberry Pi results in Error 35 (during pre-login handshake)
我想问一下我能够从 Windows
很好地连接到 SQL Server
的原因是什么,但是当我尝试连接到同一台服务器时,使用相同的连接字符串和来自 Raspbian @ Raspberry Pi
的 server being pingable
,则会发生此错误:
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)
ex.InnerException {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
--- End of inner exception stack trace ---
at Interop.OpenSsl.DoSslHandshake(SafeSslHandle context, Byte[] recvBuf, Int32 recvOffset, Int32 recvCount, Byte[]& sendBuf, Int32& sendCount)
at System.Net.Security.SslStreamPal.HandshakeInternal(SafeFreeCredentials credential, SafeDeleteContext& context, ArraySegment`1 inputBuffer, Byte[]& outputBuffer, SslAuthenticationOptions sslAuthenticationOptions)
我正在使用 System.Data.SqlClient
try
{
using (var connection = new SqlConnection(connStr))
{
connection.Open();
}
}
catch (Exception ex)
{
...
}
.NET 核心 3.1
我该如何解决?提前致谢
您可能需要更新 OpenSSL 版本。
sudo apt-get update
sudo apt-get install openssl
我按照 Leszek Mazur
建议安装(检查更新)OpenSSL:
sudo apt-get update
sudo apt-get install openssl
然后在 sudo nano /etc/ssl/openssl.cnf
我从 1.2 更改了最低版本的 TLS:
[system_default_sect]
MinProtocol = TLSv1.2
到 1.0:
[system_default_sect]
MinProtocol = TLSv1
我想问一下我能够从 Windows
很好地连接到 SQL Server
的原因是什么,但是当我尝试连接到同一台服务器时,使用相同的连接字符串和来自 Raspbian @ Raspberry Pi
的 server being pingable
,则会发生此错误:
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)
ex.InnerException {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 --- End of inner exception stack trace --- at Interop.OpenSsl.DoSslHandshake(SafeSslHandle context, Byte[] recvBuf, Int32 recvOffset, Int32 recvCount, Byte[]& sendBuf, Int32& sendCount) at System.Net.Security.SslStreamPal.HandshakeInternal(SafeFreeCredentials credential, SafeDeleteContext& context, ArraySegment`1 inputBuffer, Byte[]& outputBuffer, SslAuthenticationOptions sslAuthenticationOptions)
我正在使用 System.Data.SqlClient
try
{
using (var connection = new SqlConnection(connStr))
{
connection.Open();
}
}
catch (Exception ex)
{
...
}
.NET 核心 3.1
我该如何解决?提前致谢
您可能需要更新 OpenSSL 版本。
sudo apt-get update
sudo apt-get install openssl
我按照 Leszek Mazur
建议安装(检查更新)OpenSSL:
sudo apt-get update
sudo apt-get install openssl
然后在 sudo nano /etc/ssl/openssl.cnf
我从 1.2 更改了最低版本的 TLS:
[system_default_sect]
MinProtocol = TLSv1.2
到 1.0:
[system_default_sect]
MinProtocol = TLSv1