首页 > 数据库 >c# 连接 sql server 数据库时报错,证书链是由不受信任的颁发机构颁发的。

c# 连接 sql server 数据库时报错,证书链是由不受信任的颁发机构颁发的。

时间:2023-03-22 19:22:53浏览次数:45  
标签:c# 数据库 error server 颁发 sql

c# 连接 sql server 数据库时报错:A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 - 证书链是由不受信任的颁发机构颁发的。)

 

Our development database server was recently given a self-signed certificate so it automatically became untrusted. This resulted in the login error cited above. I added TrustServerCertificate=True to my connection string and it works now.

"Server=TheServerAddress; Database=TheDataBase; User Id=TheUsername; Password=ThePassword; TrustServerCertificate=True"

NOTE: This certificate configuration is not recommended for production environments.

标签:c#,数据库,error,server,颁发,sql
From: https://www.cnblogs.com/leon-ytparty/p/17245135.html

相关文章