Linux .net core 连接 sqlserver2008 报错

报错1

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数据库不支持

网上找了两种方式都可以试一下

  1. 路径1 /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

报错2

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版本补丁就行。

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值