Running the command dotnet dev-certs https --trust
will create a self-signed certificate in your device. This certificate will be issued to the localhost
domain. In my case, after running it, the certificate was created but it was not added to “Trusted Root Certification Authorities”.
To add the certificate, you will need to open certmgr.msc
(win+r and run certmgr.msc
), then go to “Personal” certificates and export the .cer
certificate issued to localhost
with the correct expiration time.
If you cannot find the certificate there, you can go to the browser and click on the not secure connection icon, then open the invalid certificate and go to the Details tab and click “Copy to File…”, which should create also a .cer
certificate.
Next, go to “Trusted Root Certification Authorities” and import the certificate there. Once that is done, the certificate will be valid in your local machine. You may need to restart the browser and the service.