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

    1. choco install mkcert
    2. mkcert -install
    3. mkcert -pkcs12 localhost
  • Install the certificate in the Machine Certificate Store

    1. Open Manage computer certificates control panel
    2. Find the .p12 certificate file at C:\Users<your user>
    3. Right click and install - go through wizard, selecting appropriate options
  • To assign certificate to IIS binding

    1. Right click the website
    2. Select Edit Bindings
    3. Select the https type and Edit
    4. Select the new certificate from the list (confirm it's the one that expires 10 years in the future)
  • If you use Firefox:

    1. Open options and find View Certificates
    2. Select authorities tab and Import the root certificate (run mkcert CAROOT to find the certificate location)
    3. 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