loading...

Troubleshooting .NET Core Dev Certs on MacOS

cesarcodes profile image Cesar Codes ・1 min read

In case you are getting the following error on MacOS, read on.

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

The error description suggests to solve the error by generating a certificate and then trusting it:

dotnet dev-certs https
dotnet dev-certs https --trust

If this solves you problem, cool!

If it does not, then the next step is to try to clear and regenerate the certificate:

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

If this does not solve your problem, you might have a conflicting certificate. In order to fix this, open up 'Keychain Access' from Spotlight, then on the left side, access 'Certificates' and delete the existing 'localhost' certificate. At this point, go ahead and generate/trust again:

KeyChain Access

dotnet dev-certs https
dotnet dev-certs https --trust

That will probably fix your problem. Hope it helps!

Posted on by:

cesarcodes profile

Cesar Codes

@cesarcodes

I experiment with code and talk about it.

Discussion

markdown guide
 

Many thanks, I had to delete it from keychain and It's working again

 

Thanks a lot!, it worked perfectly!

Deleting the "localhost" on the System - Certificates was the thing I was missing.

 

Thanks for the tip. Deleting the localhost from the keychain made it work!