Win10/Win11更新后无法连接SQLServer ssl安全错误
发布时间:2024/8/19 16:01:52 作者:Admin 阅读:60
广告:
1、问题:
Win10/Win11更新系统补丁后,客户端程序不能连接SQLServer2015数据库,提示异常消息:
已成功与服务器建立连接,但是在登录过程中发生错误。 (provider: SSL Provider, error: 0 - 证书链是由不受信任的颁发机构颁发的。)
2、处理
分析可能是新的补丁已经默认弃用或禁用旧版本TLS导致。在客户端电脑的PowerShell中执行如下命令后,再次运行程序连接正常。
foreach ($CipherSuite in $(Get-TlsCipherSuite).Name) { "Disabling cipher suite: " + $CipherSuite Disable-TlsCipherSuite -Name $CipherSuite } Enable-TlsCipherSuite -Name TLS_AES_256_GCM_SHA384 Enable-TlsCipherSuite -Name TLS_AES_128_GCM_SHA256 Enable-TlsCipherSuite -Name TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 Enable-TlsCipherSuite -Name TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 Enable-TlsCipherSuite -Name TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 Enable-TlsCipherSuite -Name TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 Enable-TlsCipherSuite -Name TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 Enable-TlsCipherSuite -Name TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 Enable-TlsCipherSuite -Name TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 Enable-TlsCipherSuite -Name TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 Enable-TlsCipherSuite -Name TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA Enable-TlsCipherSuite -Name TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA Enable-TlsCipherSuite -Name TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA Enable-TlsCipherSuite -Name TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA Enable-TlsCipherSuite -Name TLS_RSA_WITH_AES_256_GCM_SHA384 Enable-TlsCipherSuite -Name TLS_RSA_WITH_AES_128_GCM_SHA256 Enable-TlsCipherSuite -Name TLS_RSA_WITH_NULL_SHA256 Enable-TlsCipherSuite -Name TLS_RSA_WITH_NULL_SHA Enable-TlsCipherSuite -Name TLS_PSK_WITH_AES_256_GCM_SHA384 Enable-TlsCipherSuite -Name TLS_PSK_WITH_AES_128_GCM_SHA256 Enable-TlsCipherSuite -Name TLS_PSK_WITH_AES_256_CBC_SHA384 Enable-TlsCipherSuite -Name TLS_PSK_WITH_AES_128_CBC_SHA256 Enable-TlsCipherSuite -Name TLS_PSK_WITH_NULL_SHA384 Enable-TlsCipherSuite -Name TLS_PSK_WITH_NULL_SHA256 Enable-TlsCipherSuite -Name TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256_P256 Enable-TlsCipherSuite -Name TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384_P384 Enable-TlsCipherSuite -Name TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256 Enable-TlsCipherSuite -Name TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P384 Enable-TlsCipherSuite -Name TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA_P256 Enable-TlsCipherSuite -Name TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA_P384 Enable-TlsCipherSuite -Name TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P256 Enable-TlsCipherSuite -Name TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384 Enable-TlsCipherSuite -Name TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256_P256 Enable-TlsCipherSuite -Name TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA_P256 Enable-TlsCipherSuite -Name TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA_P384 Enable-TlsCipherSuite -Name TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA_P256 Enable-TlsCipherSuite -Name TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA_P384 Enable-TlsCipherSuite -Name TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384_P384 Enable-TlsCipherSuite -Name TLS_RSA_WITH_AES_128_CBC_SHA256 Enable-TlsCipherSuite -Name TLS_RSA_WITH_AES_128_CBC_SHA Enable-TlsCipherSuite -Name TLS_RSA_WITH_AES_256_CBC_SHA256 Enable-TlsCipherSuite -Name TLS_RSA_WITH_AES_256_CBC_SHA Enable-TlsCipherSuite -Name TLS_RSA_WITH_3DES_EDE_CBC_SHA
查看结果命令:
foreach ($CipherSuite in $(Get-TlsCipherSuite).Name) { "Enable-TlsCipherSuite -Name " + $CipherSuite }
广告:
相关文章