惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
The Cloudflare Blog
大猫的无限游戏
大猫的无限游戏
小众软件
小众软件
V
Visual Studio Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 司徒正美
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
酷 壳 – CoolShell
酷 壳 – CoolShell
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
月光博客
月光博客
The GitHub Blog
The GitHub Blog
L
LangChain Blog
D
DataBreaches.Net
T
The Blog of Author Tim Ferriss
F
Fortinet All Blogs
博客园 - Franky
阮一峰的网络日志
阮一峰的网络日志
GbyAI
GbyAI
Apple Machine Learning Research
Apple Machine Learning Research
宝玉的分享
宝玉的分享
Engineering at Meta
Engineering at Meta
V
V2EX
MyScale Blog
MyScale Blog

博客园 - cnkker.com

Visual Studio 2026 激活码 / VS2026密钥(VS2026激活码) 沙箱环境安装dotnet Microsoft Office 2024 全家桶 docker-compose 部署 Redis 的一些警告 UFW防火墙规则对Docker映射端口无效 Nginx错误 open() "/usr/local/nginx/proxy_temp/x/xx/xxxxxxxx" failed (13: Permission denied) while reading upstream解决办法 NET8在CentOS7下无法执行的问题 Nginx配置文件中,如何配置启用SignalR Error: Failed to download metadata for repo ‘appstream’ – CentOS 8 Mikrotik ROS默认推荐防火墙规则firewall脚本 dotnet堆栈溢出通用排查方法 CMD下查所有3389连接的IP地址 Nginx的proxy_pass url 反向代理的配置 一些名词 须先停止生成方可关闭解决方案(The build must be stopped before the solution can be closed) 安装最新版本NextCloud Docker、Nginx、整合LetsEncrypt SSL证书 如何将 Windows 10 Enterprise LTSC 2021 评估版升级到完整版 MS SQL 去除字段中的大小写英文、数字、特定符号 MariaDB 配置示例文件 整理一些激活密钥
NET CORE LINUX 部署 报 A connection was successfully esta...
cnkker.com · 2022-06-07 · via 博客园 - cnkker.com

部署环境:NET5

数据库:SQL SERVER 2014

操作系统:Centos8

异常:

: System.Exception: 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)
---> 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
--- End of inner exception stack trace ---

……………………………………

:line 62A 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)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
--- End of inner exception stack trace ---
at Interop.OpenSsl.DoSslHandshake(SafeSslHandle context, ReadOnlySpan`1 input, Byte[]& sendBuf, Int32& sendCount) in /_/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OpenSsl.cs:line 282
at System.Net.Security.SslStreamPal.HandshakeInternal(SafeFreeCredentials credential, SafeDeleteSslContext& context, ReadOnlySpan`1 inputBuffer, Byte[]& outputBuffer, SslAuthenticationOptions sslAuthenticationOptions) in /_/src/libraries/System.Net.Security/src/System/Net/Security/SslStreamPal.Unix.cs:line 114
--- End of inner exception stack trace ---
at System.Net.Security.SslStream.ForceAuthenticationAsync[TIOAdapter](TIOAdapter adapter, Boolean receiveFirst, Byte[] reAuthenticationData, Boolean isApm) in /_/src/libraries/System.Net.Security/src/System/Net/Security/SslStream.Implementation.cs:line 393
at System.Net.Security.SslStream.ProcessAuthentication(Boolean isAsync, Boolean isApm, CancellationToken cancellationToken) in /_/src/libraries/System.Net.Security/src/System/Net/Security/SslStream.Implementation.cs:line 215
at System.Net.Security.SslStream.AuthenticateAsClient(SslClientAuthenticationOptions sslClientAuthenticationOptions) in /_/src/libraries/System.Net.Security/src/System/Net/Security/SslStream.cs:line 297
at System.Net.Security.SslStream.AuthenticateAsClient(String targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, Boolean checkCertificateRevocation) in /_/src/libraries/System.Net.Security/src/System/Net/Security/SslStream.cs:line 283
at System.Net.Security.SslStream.AuthenticateAsClient(String targetHost) in /_/src/libraries/System.Net.Security/src/System/Net/Security/SslStream.cs:line 264
at Microsoft.Data.SqlClient.SNI.SNITCPHandle.EnableSsl(UInt32 options)
at Microsoft.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
at Microsoft.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
at Microsoft.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)

……

原因:因为SQL SERVER2014不支持 不支持TLSv1.2

最终解决办法:

修改文件:/usr/share/crypto-policies/DEFAULT/opensslcnf.txt

为:

1、 @SECLEVEL=2 修改为 @SECLEVEL=1

2、TLSv1.2 修改 TLSv1.0

再次运行,完美连接SQL SERVER