错误1:
{
"ClassName": "System.Data.SqlClient.SqlException",
"Message": "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)",
"Data": {
"HelpLink.ProdName": "Microsoft SQL Server",
"HelpLink.EvtSrc": "MSSQLServer",
"HelpLink.EvtID": "0",
"HelpLink.BaseHelpUrl": "https://go.microsoft.com/fwlink",
"HelpLink.LinkId": "20476",
"SqlError 1": "System.Data.SqlClient.SqlError: 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)"
},
"InnerException": {
"ClassName": "System.Security.Authentication.AuthenticationException",
"Message": "Authentication failed, see inner exception.",
"Data": null,
"InnerException": {
"StackTrace": " at Interop.OpenSsl.DoSslHandshake(SafeSslHandle context, Byte[] recvBuf, Int32 recvOffset, Int32 recvCount, Byte[]& sendBuf, Int32& sendCount)\n at System.Net.Security.SslStreamPal.HandshakeInternal(SafeFreeCredentials credential, SafeDeleteContext& context, ArraySegment`1 inputBuffer, Byte[]& outputBuffer, SslAuthenticationOptions sslAuthenticationOptions)",
"Message": "SSL Handshake failed with OpenSSL error - SSL_ERROR_SSL.",
"Data": {},
"InnerException": {
"StackTrace": null,
"Message": "error:1425F102:SSL routines:ssl_choose_client_version:unsupported protocol",
"Data": {},
"InnerException": null,
"HelpLink": null,
"Source": null,
"HResult": 338030850
},
"HelpLink": null,
"Source": "System.Net.Security",
"HResult": -2146233088
},
问题和解决方法:
应该是 SQL Server 2008 R2 或其所在服务器支持的加密协议版本过低(不再安全),新版客户端已不再支持。
修改容器中 openssl 文件配置的最低允许使用的协议版本即可:
sed -i -e "s|^MinProtocol = .*|MinProtocol = TLSv1.0|g" "/etc/ssl/openssl.cnf"
另附,查询当前系统支持的加密协议:
openssl ciphers -v | awk '{print $2}' | sort | uniq
但解决了上一个问题,接下来就遇到了
错误2:
{
"ClassName": "System.Data.SqlClient.SqlException",
"Message": "Connection Timeout Expired. The timeout period elapsed during the post-login phase. The connection could have timed out while waiting for server to complete the login process and respond; Or it could have timed out while attempting to create multiple active connections. The duration spent while attempting to connect to this server was - [Pre-Login] initialization=0; handshake=9; [Login] initialization=0; authentication=0; [Post-Login] complete=14454; ",
"Data": {
"HelpLink.ProdName": "Microsoft SQL Server",
"HelpLink.EvtSrc": "MSSQLServer",
"HelpLink.EvtID": "-2",
"HelpLink.BaseHelpUrl": "https://go.microsoft.com/fwlink",
"HelpLink.LinkId": "20476",
"SqlError 1": "System.Data.SqlClient.SqlError: Connection Timeout Expired. The timeout period elapsed during the post-login phase. The connection could have timed out while waiting for server to complete the login process and respond; Or it could have timed out while attempting to create multiple active connections. The duration spent while attempting to connect to this server was - [Pre-Login] initialization=0; handshake=9; [Login] initialization=0; authentication=0; [Post-Login] complete=14454; "
},
"InnerException": {
"ClassName": "System.ComponentModel.Win32Exception",
"Message": "Unknown error 258",
"Data": null,
"InnerException": null,
"HelpURL": null,
"StackTraceString": null,
"RemoteStackTraceString": null,
"RemoteStackIndex": 0,
"ExceptionMethod": null,
"HResult": -2147467259,
"Source": null,
"WatsonBuckets": null,
"NativeErrorCode": 258
},
问题和解决方法:
暂未找到,同样的程序在 windows 下暂未遇到此问题。
标签:core,HelpLink,r2,error,System,server,sql,null,Data From: https://www.cnblogs.com/xwgli/p/18168562