I am working on a fabric application where I have configured HTTPS. It is throwing an exception though I have a valid installed certificate.
In windows, dotnet dev-certs https --clean
doesn't work for me, I have to delete these localhost certs manually.
dotnet dev-certs https -t
For more details visit the GitHub issue page here also the official documentation Here
Not sure if this will help anybody else but I had exactly this issue on my Mac. I have the project in Dropbox and so it is shared across machines, on the '2nd' machine I had to go in and manually delete the 'obj' and 'bin' folders, then re-run the application and it all worked
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.
localhost
certificatedotnet 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
I had this issue on my Windows 10 system using visual studio. The problem seemed to be that the command used in the GUI to clear the local certs for HTTPS was failing with an error message that I can no longer reproduce.
The solution for me was to open the certmgr for the current windows account and to delete all of the personal localhost certs. There was ~20 certs there for me because I've tried re-creating them many times. After deleting all of those certs I ran my .Net core HTTPS API once more and everything worked!
In summary, open your certmgr for your current user and clear all personal/localhost certs.
I had the same issues and cleaning -> then installing certs helped me (another answer here). You also may issue a certificate as like for production server. Quite helpful to know.