Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@itsMattShull
Created June 26, 2018 03:33
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save itsMattShull/b256b77c4d917cb49f6cb8996452bcbc to your computer and use it in GitHub Desktop.
Save itsMattShull/b256b77c4d917cb49f6cb8996452bcbc to your computer and use it in GitHub Desktop.
Command to create a key.pem and cert.pem for localhost
openssl req \
-newkey rsa:2048 \
-x509 \
-nodes \
-keyout key.pem \
-new \
-out cert.pem \
-subj /CN=localhost \
-reqexts SAN \
-extensions SAN \
-config <(cat /System/Library/OpenSSL/openssl.cnf \
<(printf '[SAN]\nsubjectAltName=DNS:localhost')) \
-sha256 \
-days 3650
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment