Skip to content

Instantly share code, notes, and snippets.

@georgechang
Last active April 3, 2021 15:46
Show Gist options
  • Select an option

  • Save georgechang/4e233ce3e5005dfb3309a27ab0d2f0c3 to your computer and use it in GitHub Desktop.

Select an option

Save georgechang/4e233ce3e5005dfb3309a27ab0d2f0c3 to your computer and use it in GitHub Desktop.

Revisions

  1. georgechang renamed this gist Apr 3, 2021. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. georgechang created this gist Apr 3, 2021.
    3 changes: 3 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    New-SelfSignedCertificate -DnsName domain.com -CertStoreLocation Cert:\LocalMachine\My -KeyExportPolicy Exportable -NotAfter (Get-Date).AddYears(3) | Export-PfxCertificate -FilePath .\cert.pfx -Password (ConvertTo-SecureString -String "secret" -AsPlainText -Force)
    openssl pkcs12 -in cert.pfx -nocerts -out cert.key
    openssl pkcs12 -in cert.pfx -clcerts -nokeys -out cert.crt