NET6 EF Error: The certificate chain was issued by an authority that is not trusted

Robot / 2023-07-28 / 原文

Error

A connection was successfully established with the server, but then an error occurred during the login process.
 (provider: SSL Provider, error: 0 - The certificate chain was issued by an authority that is not trusted.)

解决方法:

在DB连接字符串后面添加证书信任配置:TrustServerCertificate=true