There was an error saving the HTTPS developer certificate to the current user personal certificate store

4.1k Views Asked by At

I have installed the .Net Core SDK and I am trying to install the developer certificates so that i can work on the HTTPS projects which come by default

I have run:

    dotnet dev-certs https

but i encounter the error:

    There was an error saving the HTTPS developer certificate to the current user personal certificate store.

I restarted the computer, ensured no browser was running and tried again but it still doesnt work.

Any help would be greatly appreciated

EDIT:

I am using Windows 8.1, and my .net Core version is 2.1.5

3

There are 3 best solutions below

1
On BEST ANSWER

Try this command:

dotnet dev-certs https --clean

and then

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

If that doesn't work try deleting your localhost certificate manually and then run those commands again.

I had the very same problem but on Mac. There I had to uninstall .net core SDK and delete all the folders in the library too. Which actually might be a solution as well. And then I ran those commands again and they worked.

Anyway if it is not mandatory for you to use https in your development stage you can comment

app.UseHttpsRedirection();

inside your Configure method in your startup.cs and remove https addresses inside Properties/launchSettings.json

0
On

ı'stuck in this problem. I also tried these " dotnet dev-certs https" commands and modified sertificates in the personel sertificate. But it still wasn't working.
I use .net 7.0 and vs 2022
ı just check my configuration in Webapi=>properties=>launchSettingjson. And add:

"IIS Express": {
  "commandName": "IISExpress",
  "launchBrowser": true,
  "launchUrl": "swagger",
  "environmentVariables": {
    "ASPNETCORE_ENVIRONMENT": "Development"
  }
}

it works.

0
On

What has solved my issue is as below, you can check it too.

I have changed my account username in registry some days ago and it was unsuccessful. The windows created a temp user that it made some problems in environment variables and their paths. I suggest you to check env paths and cert paths to ensure their correctness.

Managing the temp user account in windows, solved this problem for me.

You can check windows temp user issue in this link: https://winaero.com/windows-10-youve-been-signed-in-with-a-temporary-profile/