Last active
June 11, 2018 10:47
-
-
Save nischithbm/c7045bc05c97a5dc764625fcf6d946f9 to your computer and use it in GitHub Desktop.
Convert PEM file to .key and .crt
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 pkcs12 -in localhost.p12 -out server.pem -nodes | |
openssl rsa -in server.pem -out server.key | |
openssl x509 -in server.pem -out server.crt | |
---- | |
openssl req -x509 -sha256 -nodes -newkey rsa:2048 -days 365 -keyout server.key -out server.crt -subj "/C=US/CN=localhost" -reqexts SAN -extensions SAN -config <(cat /etc/ssl/openssl.cnf \ | |
<(printf "[SAN]\nsubjectAltName=DNS:localhost")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment