DEV Community 👩‍💻👨‍💻

Cesar Codes
Cesar Codes

Posted on

Troubleshooting .NET Core Dev Certs on MacOS

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!

Top comments (6)

jgeorge718 profile image

Hi there,

I've followed all the steps outlined and still face this issue. There aren't any localhost certificates in my KeyChain, I run "dotnet dev-certs https" and get still get "There was an error saving the HTTPS developer certificate to the current user personal certificate store."

Any suggestions to resolve this?

Thank you!

borjasanes profile image
Borja García • Edited on

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

alijawad987 profile image
Ali Ibrahim Jawad

Thanks! Deleting the localhost certificate and regenerating it using the dotnet dev-certs command worked for me. Thanks again!

scarreno profile image
Sergio Carreño

Thanks a lot!, it worked perfectly!

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

biospring profile image
Hoon Chung

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

_nando_ profile image
Fernando Bertin

You're a life saver man! Deleting the existing localhost cert and regenerating it solved my problem, thanks!!!

🌚 Friends don't let friends browse without dark mode.

Sorry, it's true.