Created
June 26, 2018 03:33
-
-
Save itsMattShull/b256b77c4d917cb49f6cb8996452bcbc to your computer and use it in GitHub Desktop.
Command to create a key.pem and cert.pem for localhost
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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