SSL Provider, error: 0 - The target principal name is incorrect

  工作记录:

  netcore2.2升级了netcore6.0后,由于DB的链接转为内网没有SSL证书,SqlClient升级导致程序链接DB报错:

  SSL Provider, error: 0 - The target principal name is incorrect

  通过查找github,找到解决方法,链接字符串需要添加Trust Server Certificate = true;就解决

  参考网址:https://github.com/dotnet/SqlClient/issues/795

posted @ 2024-02-27 17:56  李大飞  阅读(26)  评论(0编辑  收藏  举报