Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ilfroloff/6589031198df242081141f50c17236ec to your computer and use it in GitHub Desktop.
Save ilfroloff/6589031198df242081141f50c17236ec to your computer and use it in GitHub Desktop.
Self-signed SSL Certificates for Node.js HTTPS servers

PFX

Simple PFX generation (source)

openssl genrsa 2048 > private.pem
openssl req -x509 -new -key private.pem -out public.pem # fill options
openssl pkcs12 -export -in public.pem -inkey private.pem -out mycert.pfx

KEY/CERT

openssl genrsa -des3 -passout pass:x -out server.pass.key 2048
openssl rsa -passin pass:x -in server.pass.key -out server.key
openssl req -new -key server.key -out server.csr # fill options
openssl x509 -req -sha256 -days 365 -in server.csr -signkey server.key -out server.crt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment