Run PowerShell as admin, then run:
New-SelfSignedCertificate -certstorelocation cert:\localmachine\my -Subject my-domain.com -Type SSLServerAuthentication –DnsName my-domain.com,somesubdomain.my-domain.com
(replace my-domain.com with your own domain)
Go to the “Server Certificates” page in IIS Manager, right click on your new cert, select “View”, go to the “Details” tab, click the “Copy to file” button, just keep clicking next until it asks for a file name, then just save it somewhere.
Open the newly saved certificate, and click the “Install certificate” button, and install it into the current user’s “Trusted Root Certificate Authorities” store (Automatic store selection won’t do.).
Go back to IIS Manager, select your site, go to its Bindings, click “Add”, enter your domain, select “https” in the dropdown, and just select your cert.
Make sure to add the domain to the hosts file pointing to 127.0.1!