当前位置:   article > 正文

Linux .net core 连接 sqlserver2008 报错_a connection was successfully established with the

a connection was successfully established with the server, but then an error

报错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
  • 1
  • 2
  • 3

链接: 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
  • 1
  • 2
  • 3
  • 4
  • 5

链接: 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)
  • 1
  • 2
  • 3
  • 4

.net core在linux上运行需要SQL Server 2008 R2 SP3版本以上,RTM是最基础的版本,需要在这之上打补丁,SP1,SP2,SP3等等,每个版本都会继承上个版本的补丁,所以只用打SP3版本补丁就行。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/花生_TL007/article/detail/601796
推荐阅读
相关标签
  

闽ICP备14008679号