首页 > 解决方案 > 从 Raspberry Pi 连接到 SQL Server 导致错误 35(在登录前握手期间)

问题描述

我想问一下我能够很好地连接到SQL Serverfrom的原因可能是什么Windows,但是当我尝试使用相同的连接字符串和server being pingablefrom连接到同一台服务器时,Raspbian @ Raspberry Pi会发生此错误:

与服务器成功建立连接,但在登录前握手期间发生错误。(提供者:TCP 提供者,错误:35 - 捕获到内部异常)


ex.InnerException {System.Security.Authentication.AuthenticationException:身份验证失败,请参阅内部异常。---> Interop+OpenSsl+SslException:SSL 握手失败,出现 OpenSSL 错误 - SSL_ERROR_SSL。---> Interop+Crypto+OpenSslCryptographicException: error:1425F102:SSL routines:ssl_choose_client_version:unsupported protocol --- 内部异常堆栈跟踪结束 --- 在 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

我该如何解决?提前致谢

标签: c#sql-server.net-coreraspberry-pi3raspbian

解决方案


您可能需要更新 OpenSSL 版本。

sudo apt-get update
sudo apt-get install openssl

推荐阅读