Skip to content

Instantly share code, notes, and snippets.

@collinsrj
Last active August 29, 2015 14:25
Show Gist options
  • Save collinsrj/62629c6f0ce31eb4e801 to your computer and use it in GitHub Desktop.
Save collinsrj/62629c6f0ce31eb4e801 to your computer and use it in GitHub Desktop.
# The following is an example - it may not represent best practice. Your security is your own responsibility.
# Create the fake CA key and cert.
openssl genrsa -des3 -out ca.key 2048
openssl req -new -x509 -sha256 -days 365 -key ca.key -out ca.crt
# Generate a key for the server
openssl genrsa -out server.key 2048
# for this next command, make sure you specify your domain as the Common Name e.g. example.com
openssl req -new -key server.key -out server.csr
openssl x509 -sha256 -req -in server.csr -out server.crt -CA ca.crt -CAkey ca.key -CAcreateserial -days 365
# This next step is optional. It's not required for our little Node app, but not all servers accept the simple format.
openssl pkcs12 -export -out server.pfx -inkey server.key -in server.crt -certfile ca.crt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment