Ubuntu 22.04 + Jetbrains Rider无法运行集成测试



你好,我是ubuntu的新用户(安装了22.04版本),我从一开始就有问题…目前我正在努力运行集成测试与Jetbrains Rider(我运行应用程序没有任何问题,并连接到这个数据库)。

我得到的错误是:

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
at System.Net.Security.SslStream.ForceAuthenticationAsync[TIOAdapter](TIOAdapter adapter, Boolean receiveFirst, Byte[] reAuthenticationData, Boolean isApm)
at System.Net.Security.SslStream.ProcessAuthentication(Boolean isAsync, Boolean isApm, CancellationToken cancellationToken)
at System.Net.Security.SslStream.AuthenticateAsClient(SslClientAuthenticationOptions sslClientAuthenticationOptions)
at System.Net.Security.SslStream.AuthenticateAsClient(String targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, Boolean checkCertificateRevocation)
at System.Net.Security.SslStream.AuthenticateAsClient(String targetHost)
at System.Data.SqlClient.SNI.SNITCPHandle.EnableSsl(UInt32 options)
System.TypeInitializationException
The type initializer for 'SslMethods' threw an exception.
at Interop.OpenSsl.AllocateSslContext(SslProtocols protocols, SafeX509Handle certHandle, SafeEvpPKeyHandle certKeyHandle, EncryptionPolicy policy, SslAuthenticationOptions sslAuthenticationOptions)
at System.Net.Security.SafeDeleteSslContext..ctor(SafeFreeSslCredentials credential, SslAuthenticationOptions sslAuthenticationOptions)
at System.Net.Security.SslStreamPal.HandshakeInternal(SafeFreeCredentials credential, SafeDeleteSslContext& context, ReadOnlySpan`1 inputBuffer, Byte[]& outputBuffer, SslAuthenticationOptions sslAuthenticationOptions)
System.TypeInitializationException
The type initializer for 'Ssl' threw an exception.
at Interop.Ssl.SslV2_3Method()
at Interop.Ssl.SslMethods..cctor()
System.TypeInitializationException
The type initializer for 'SslInitializer' threw an exception.
at Interop.Ssl..cctor()
Interop+Crypto+OpenSslCryptographicException
error:0E076071:configuration file routines:MODULE_RUN:unknown module name
at Interop.SslInitializer..cctor()

Ubuntu 22.04, .dotnet 5.0.213, Rider 2022.1

有人遇到过这样的问题吗?

这可能是由于OpenSSL配置。我也遇到过类似的问题,用下面的命令解决了这个问题:

sed -i 's/openssl_conf = openssl_init/#openssl_conf = openssl_init/g' /etc/ssl/openssl.cnf 

看到在github上提交和Github问题

查看详细信息。

您可以尝试在您的连接字符串中添加:Encrypt=False;TrustServerCertificate=True"当然,这只是一个临时解决方案,只能用于测试。

最新更新