Last active
October 25, 2016 02:46
-
-
Save gregjhogan/cbe54d793fbb20a0ae64ba9bdd34f1ff to your computer and use it in GitHub Desktop.
generate new openssl SSL key/cert/csr/pfx
This file contains hidden or 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
| NAME=test-cert | |
| # generate key | |
| openssl genrsa -out $NAME.key 2048 | |
| # generate certificate request | |
| openssl req -new -sha256 -key $NAME.key -out $NAME.csr | |
| # self-sign certificate (if not sending to CA) | |
| openssl x509 -req -days 3650 -in $NAME.csr -signkey $NAME.key -out $NAME.crt | |
| # convert to pfx | |
| openssl pkcs12 -export -out $NAME.pfx -inkey $NAME.key -in $NAME.crt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment