在 Sql Server 连接字符串中使用 Encrypt=yes ->“提供商:SSL 提供商,错误:0 - 证书的 CN 名称与传递的值不匹配." [英] Using Encrypt=yes in a Sql Server connection string -> "provider: SSL Provider, error: 0 - The certificate's CN name does not match the passed value."

查看:12
本文介绍了在 Sql Server 连接字符串中使用 Encrypt=yes ->“提供商:SSL 提供商,错误:0 - 证书的 CN 名称与传递的值不匹配."的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 SQL Server 连接字符串中使用 Encrypt=yes,因为我需要加密 TCPIP 流量,但是在打开连接时出现错误:

I'm using Encrypt=yes in a SQL Server connection string, as I need the TCPIP traffic to be encrypted, but on opening the connection I get an error:

A connection was successfully established with the server, but then an error
occurred during the pre-login handshake. (provider: SSL Provider, error: 0 -
The certificate's CN name does not match the passed value.)

有什么建议可以解决这个问题吗?我假设我的服务器之间需要某种证书关系,但不知道从哪里开始.

Any suggestions how to fix this? I assume I need some sort of certificate relationship between my servers, but have no idea where to start.

我需要两个连接,一个连接到 SQL 2000 服务器,一个连接到 2005 服务器.

I need this for two connections, one each to a SQL 2000 server and one to a 2005 server.

推荐答案

您的数据库连接可以配置为加密流量并接受来自您服务器的任何证书.不是一个伟大的解决方案,但它对我有用.

Your database connection can be configured to encrypt traffic and to accept any certificate from your server. Not a grand solution, but it worked for me.

生成的连接字符串应如下所示:

The resulting connection string should look like this:

"[...];Encrypt=True;TrustServerCertificate=True"

这篇关于在 Sql Server 连接字符串中使用 Encrypt=yes ->“提供商:SSL 提供商,错误:0 - 证书的 CN 名称与传递的值不匹配."的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆