What used to be a fairly cumbersome exercise is now almost trivial thanks to mkcert
In short:
-
Install mkcert (see options in the mkcert link above - my preference is to install through chocolatey and create certificate
- choco install mkcert
- mkcert -install
- mkcert -pkcs12 localhost
-
Install the certificate in the Machine Certificate Store
- Open Manage computer certificates control panel
- Find the .p12 certificate file at C:\Users<your user>
- Right click and install - go through wizard, selecting appropriate options
-
To assign certificate to IIS binding
- Right click the website
- Select Edit Bindings
- Select the https type and Edit
- Select the new certificate from the list (confirm it’s the one that expires 10 years in the future)
-
If you use Firefox:
- Open options and find View Certificates
- Select authorities tab and Import the root certificate (run mkcert CAROOT to find the certificate location)
- On succesful root CA import, import the locathost certificate ○ Select the Your Certificates tab ○ Select Import and import the .p12 file imported into the certificate store earlier