How to install dev(localhost) certificate on windows

If you want to run localhost in https protocol, you must need to install the localhost certificate in LocalMachine region. To do the same – execute below command from powershell(admin mode)

dotnet dev-certs https –trust

verify if the certificate install has happend in the CurrentUser region or LocalMachine(Computer) region

If you could something like below in “Personal” section of “Manage computer certificate” then all good to go

If the certificate is not visible then it must be installed under “Manage user certificate”, in that case we need to first export the certificate and then manually install it under LocalMachine. To do so, execute below command

dotnet dev-certs https –export-path “e:\myfile.crt”

ignore the warning the you see in powershell and double click on myfile.crt to install

Click on Install Certificate

Choose Local Machine and click Next

Choose “Place all certificate in following store” and choose Personal. Click “Ok”. And then click “Next”

After installation do the same step again for “Trusted Root Certification Authorities” region.

Write comment if you face any issue.

Leave a Reply

Your email address will not be published. Required fields are marked *