1. Use Choco install to install mkcert.
2. Add mkcert to your local root CAs.
3. In terminal run mkcert -install
This will generate a local certificate authority (CA). Your mkcert-generated local CA is only trusted locally, on your device.
Now we need to generate a certificate for your site, signed by mkcert.In your terminal, navigate to your site's root directory or whichever directory you'd like the certificates to be located at.
mkcert localhost
OR
mkcert mysite.example
For use on IIS use the format pkcs12.
mkcert -pkcs12 somedomain.net
NOTE: replace somedomain.net with the domain you will be using locally. You can specify multiple domains (space-delimited) and even wildcard subdomains via *.somedomain.net
The command above will create a somedomain.net.p12 file in the folder where you invoked the mkcert command. This file is a PKCS#12 certificate, which is what IIS requires.
Rename the .p12 file to .pfx
IIS expects imported PKCS#12 certificates to have a .pfx extension. Be sure to rename the generated .p12 certificate to .pfx
Now the cert needs to be imported in the MMC certificates store or whatever.
To be able to then be append the https cert binding in IIS.
Right click on the window and file to import.
select your cert.
It will require a password that is specified in the response from mkcert when creating it.
Fore info
https://web.dev/how-to-use-local-https/
OBS: Note when you add this cert to IIS use the "Rquire Server name Indication"