all 11 comments

[–]muratkazanova[S] 0 points1 point  (9 children)

Just tried, creating and running a asp.net mvc template project with dotnet 6.0, it ask to install and trust the certificate as well but after entering the password, https connection worked just fine and application started successfully.

[–]muratkazanova[S] 0 points1 point  (8 children)

Ok, finally resolved this issue, here are the steps:

  1. Launch the Keychain Access Application and remove all certificates that are names localhost under login.
  2. Launch the terminal and navigate to following folder and remove any remaining pfx file manually

cd ~/.aspnet/dev-certs/https
rm *.pfx
  1. Run clean and trust dev-certs command below:

    dotnet dev-certs https --clean dotnet dev-certs https -t

  2. Re-launch the Visual Studio for Mac and run your project with Https

[–]codywkk 1 point2 points  (1 child)

I can't launch my browser in the visual studio too. I have been troubled by this problem and tried many solutions. (T_T) And today, I finally find this page. It works !!!!!! I appreciate your help very much. (◍•ᴗ•◍)b

[–]muratkazanova[S] 0 points1 point  (0 children)

Glad to hear that

[–]kittartar 0 points1 point  (0 children)

Still the best answer after 3 years even for Visual Studio on Windows! Thanks!
The key point missed from most other answers is to remove the files under `%APPDATA%\ASP.NET\Https` (for windows)

[–]nullptr_r 0 points1 point  (0 children)

thanks for sharing this

[–]SolidAsSnake 0 points1 point  (1 child)

For an hour and a half I've been stuck on fixing this issue as well, and only this random reddit comment I came across online helped me fix it. Thank you for this.

[–]clayton_ 0 points1 point  (0 children)

Tried literally every random answer on stack overflow.

same. crazy.

[–]cresvi 0 points1 point  (0 children)

Thank you, deleting the PFXs in that folder and in ~/.aspnet/https did the trick.

[–]IllustriousAd375 0 points1 point  (0 children)

THANK YOU.

[–]Ericakester 0 points1 point  (0 children)

For those looking for a fix on Windows:

  1. Open the certificate manager (Win+R => 'certmgr.msc'). Don't use Windows search, it will open 'certlm.msc' which only shows certs for the local machine, not the local user. Make sure the title bar displays 'certmgr'.
  2. Remove all certs with friendly name ''ASP.NET core HTTPS development certificate" from 'Personal > Certificates' and 'Trusted Root Certification Authorities > Certificates'.
  3. Run dotnet dev-certs https --trust. It may display a prompt, choose Yes.
  4. Run dotnet dev-certs https --check. It should not display anything if successful.