Ortund
Ortund

Reputation: 8245

Why don't I have ASP.NET Core HTTPS development certificate?

I'm having trouble in that running my brand new ASP.NET Core app in that it fails to load the website when I run the debugger (see screenshot at the bottom of the question).

I have a hunch this is because of an issue with the certificate so I tried to trust the certificate with the following command:

dotnet dev-certs https --trust

It errors:

PM> dotnet dev-certs https --trust
Trusting the HTTPS development certificate was requested. A confirmation prompt will be displayed if the certificate was not previously trusted. Click yes on the prompt to trust the certificate.
There was an error trusting HTTPS developer certificate.
PM> dotnet dev-certs https --check
A valid certificate was found.
PM>

There's a valid certificate but checking certificates per this answer, I don't see the certificate in Personal/Certificates or in Trusted Root Certification Authorities/Certificates either.

I'm a little stumped on a resolution; this affects all my Core applications so I can't get any development done.

Why don't I have a certificate there and how can I rectify this?

enter image description here

Upvotes: 7

Views: 8912

Answers (1)

user23089173
user23089173

Reputation: 1

Sometimes you have to remove "old" certificates - check if you have more than one certificate installed (dotnet dev-certs https -v). If this is the case the following steps helped in my case.

  • Finish Visual Studio
  • Remove all certificates by calling dotnet dev-certs https --clean (command line admin mode)
  • Create a new certificate by calling dotnet dev-certs https --trust
  • Start Visual Studio again

Upvotes: 0

Related Questions