赞
踩
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)
原因是因为linux要求使用的TLS版本较高,而SqlServer数据库不支持
网上找了两种方式都可以试一下
/etc/ssl/openssl.cnf
修改配置(不存在就新建)[system_default_sect]
MinProtocol = TLSv1
CipherString = DEFAULT@SECLEVEL = 1
链接: https://blog.csdn.net/u010476739/article/details/116740485
2. 路径2 /usr/share/crypto-policies/DEFAULT/opensslcnf.txt
修改配置
SECLEVEL=2
改为SECLEVEL=1
MinProtocol = TLSv1.2
改为MinProtocol = TLSv1.0
CipherString = @SECLEVEL=1:kEECDH:kRSA:kEDH:kPSK:kDHEPSK:kECDHEPSK:-aDSS:-3DES:!DES:!RC4:!RC2:!IDEA:-SEED:!eNULL:!aNULL:!MD5:-SHA384:-CAMELLIA:-ARIA:-AESCCM8
Ciphersuites = TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256:TLS_AES_128_CCM_SHA256
MinProtocol = TLSv1.0
MaxProtocol = TLSv1.3
SignatureAlgorithms = ECDSA+SHA256:ECDSA+SHA384:ECDSA+SHA512:ed25519:ed448:rsa_pss_pss_sha256:rsa_pss_rsae_sha256:rsa_pss_pss_sha384:rsa_pss_rsae_sha384:rsa_pss_pss_sha512:rsa_pss_rsae_sha512:RSA+SHA256:RSA+SHA384:RSA+SHA512:ECDSA+SHA224:RSA+SHA224:ECDSA+SHA1:RSA+SHA1
链接: https://www.cnblogs.com/CnKker/p/16352905.html
SqlException报错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=22; handshake=97; [Login] initialization=2; authentication=7; [Post-Login] complete=14358;
运行sqlserver命令select @@version
查看sqlserver版本
Microsoft SQL Server 2008 R2 (RTM) - 10.50.1600.1 (X64)
Apr 2 2010 15:48:46
Copyright (c) Microsoft Corporation
Enterprise Edition (64-bit) on Windows NT 6.2 <X64> (Build 9200: ) (Hypervisor)
.net core在linux上运行需要SQL Server 2008 R2 SP3版本以上,RTM是最基础的版本,需要在这之上打补丁,SP1,SP2,SP3等等,每个版本都会继承上个版本的补丁,所以只用打SP3版本补丁就行。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。