I’m working on a project using Windows 10, IIS 10, and SQL Server installed locally with standard Windows authentication configurations, along with Visual Studio 2022. I developed an ASP.NET Core Web API that interfaces with my SQL Database using this connection string:
Server=localhost;Database=Shipwrecks;User id=apilogin;Password=xxxxx;TrustServerCertificate=true;MultipleActiveResultSets=true;
I’ve successfully published and accessed the API via https://localhost:8081/api/Expeditions/1001. In my Blazor web project developed in Visual Studio, everything works fine in debug mode, but after deploying it to the local IIS, I encounter a connection error.
I would like to understand why the API behaves differently when it is accessed through a web page compared to a direct entry in the browser. Any insights would be appreciated!
Here’s the error message I’m receiving:
System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception.
---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid because of errors in the certificate chain: UntrustedRoot...
I’ve tried various configurations for the API’s connection string, including using the IP address, localhost, and the computer’s name.