Cannot create developer certificate on Mac

橙三吉。 提交于 2020-01-24 12:43:16

问题


This happened overnight. Yesterday I was able to work on my .NET Core we application. Now every time I try to do a dotnet run I get the following error in my cmd line:

As you can see, I tried running the suggested commands to create a developer certificate which are dotnet dev-certs https and then dotnet dev-certs https --trust. Running both of them, I get

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

Before I ran those commands, I read on this page that I had two competing localhost certifications in my Keychain. So I go in the keychain to delete one of them to no avail. I then delete the other thinking that I can recreate it somehow. Hence me running the commands above.

I then found out that I get the same "There was an error saving the HTTPS..." error for most variations of the command dotnet dev-certs https [options] options (options can be found running dotnet dev-certs https -h

Anyone know why I might be getting this error? How can I get more info as to why it's not able to save to the "certificate store"? It seems like I'm being denied access to some kind of folder.


回答1:


Just open Keychain Access on your Mac

  • Unlock it
  • Lock it
  • Unlock it

and retry




回答2:


Ok, so I finally just restarted my computer. When I ran the dotnet run command in VS Code, some prompt came up asking me for my password to allow something in keychain to get access to....something. I should taken a screenshot....my bad. When I put in my password, I received the same error. I, again, followed the steps to create a dev certification by entering the dotnet commands in the initial question. Then I ran dotnet run a second time and viola. It works.

No idea what happened. If anyone can provide some insight then that would be awesome.

If you're experiencing the same problem, then try restarting your computer and following those prompts.



来源:https://stackoverflow.com/questions/54371101/cannot-create-developer-certificate-on-mac

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!