How to create an IIS Self-Signed SSL certification for 10 years or longer

By admin, June 3, 2021 6:00 pm

The solution is quite easy with PowerShell

New-SelfSignedCertificate -CertStoreLocation Cert:\LocalMachine\My -DnsName “stargate.domainname.com” -FriendlyName “Stargate” -NotAfter (Get-Date).AddYears(20)

Using certmgr, make sure copy it from Personal Certificates to the Trusted Root Certification Authorities, or it won’t appear in IIS Server Certification.