Skip to content

Instantly share code, notes, and snippets.

@nischithbm
Last active June 11, 2018 10:47
Show Gist options
  • Save nischithbm/c7045bc05c97a5dc764625fcf6d946f9 to your computer and use it in GitHub Desktop.
Save nischithbm/c7045bc05c97a5dc764625fcf6d946f9 to your computer and use it in GitHub Desktop.
Convert PEM file to .key and .crt
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