Unable to configure HTTPS endpoint. No server certificate was specified, and the default developer certificate could not be found

Solution 1:

These instructions from this blog worked for me

  1. dotnet dev-certs https --clean
  2. dotnet dev-certs https -t
  3. Restart VS

Solution 2:

I am on OSX and dotnet dev-certs https --clean and sudo dotnet dev-certs https --clean were not working for me. Finally I was able to fix it with the following steps.

  1. Go into Keychain Access
  2. Unlock System Keychain
  3. Delete the localhost certificate
  4. Run dotnet dev-certs https -t

You should now be able to run without the error.

Edit:

If, after following the above answer, you do run into an error that reads There was an error saving the HTTPS developer certificate... check out this answer https://stackoverflow.com/a/56709117/621827

Solution 3:

Solution

(for Windows, not sure if there's an equivalent issue/solution for other OSs)

In a command prompt or Powershell terminal:

  • Run certmgr.msc and delete all localhost certificates under both Personal\Certificates and Trusted Root Certification Authorities\Certificates.
  • Then run dotnet dev-certs https -t a single time to create and trust a new development certificate.
  • Verify by running dotnet dev-certs https --check --verbose, or just try debugging your ASP.NET app again.

You may also need to run dotnet dev-certs https --clean before creating the new certificate.