.NET Core Console App: The remote certificate is invalid because of errors in the certificate chain: UntrustedRoot

Viewed 2792

I have a .NET Core Console app, and I'm trying to send an HttpRequest to a locally running version of my application. I'm sending a POST request with an auth token from Microsoft to our authentication endpoint, and essentially just trying to validate it.

With each request, I run into the following exception: The remote certificate is invalid because of errors in the certificate chain: UntrustedRoot

I don't know much about certificates, so any guidance here would be greatly appreciated.

1 Answers

You can refer to the official link,and try the commands in it.

dotnet dev-certs https --clean
dotnet dev-certs https --trust
Related