Skip to content

Instantly share code, notes, and snippets.

@litodam
Last active June 8, 2017 03:02
Show Gist options
  • Save litodam/696921a9eb34cabd15099228243901f2 to your computer and use it in GitHub Desktop.
Save litodam/696921a9eb34cabd15099228243901f2 to your computer and use it in GitHub Desktop.
Create Self-signed certificate for IIS (with Subject Alternative Name)
# Requires PowerShell to be run as Admin.
New-SelfSignedCertificate -CertStoreLocation cert:\localmachine\my -Provider "Microsoft Enhanced RSA and AES Cryptographic Provider" -Subject "cn=lito.com" -DnsName "lito.com" -KeyDescription "lito.com" -NotBefore (Get-Date).AddDays(-1) -NotAfter (Get-Date).AddYears(2) -FriendlyName "Self Signed Cert for lito.com"
# After creating it open the Certificate Store and copy the cert under Trusted Root Certificate Authorities
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment