我一直在尝试建立一个应用程序在.net核心6. 0,但我面临的问题,而连接到sql边缘服务器运行在docker。我一直在mac上运行它。
下面是我在appsettings.json中使用的连接字符串。
"TheatreApiDb":"Server=localhost;Database=Theatre;User=SA;Password=P@ssw0rd;Trusted_Connection=True;"
每当我尝试连接到服务器时,都会出现此运行时错误。
Microsoft.Data.SqlClient.SqlException: "A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: TCP Provider, error: 35 - An internal exception was caught)" ---> System.Security.Authentication.AuthenticationException: "The remote certificate was rejected by the provided RemoteCertificateValidationCallback."
我尝试了很多方法来解决这个问题,但都无法解决。
尝试将端口号放入连接字符串中,但无法解析。
1条答案
按热度按时间ymdaylpp1#
尝试将
TrustServerCertificate=True
添加到连接字符串中。为了完整起见,下面是完整的连接字符串