Microsoft.Data.SqlClient.SqlException证书链是由不受信任的颁发机构颁发的
异常信息
Microsoft.Data.SqlClient.SqlException:“A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 - 证书链是由不受信任的颁发机构颁发的。)”
解决方案
SqlServer连接字符串添加参数: TrustServerCertificate = true;
C# 全选
Server={0};Database={1};User ID={2};Password={3}; Max Pool Size=512; Pooling=true;Connect Timeout={4};MultipleActiveResultSets=true;TrustServerCertificate=true;
版权声明:本文为开发框架文库发布内容,转载请附上原文出处连接
NewDoc C/S框架网