Skip to content

Instantly share code, notes, and snippets.

@vandorjw
Created October 17, 2013 21:18
Show Gist options
  • Save vandorjw/7032355 to your computer and use it in GitHub Desktop.
Save vandorjw/7032355 to your computer and use it in GitHub Desktop.
Generate a self signed certificate using openssl
#!/bin/bash
openssl genrsa -aes256 -passout pass:x -out server.pass.key 2048
openssl rsa -passin pass:x -in server.pass.key -out server.key
rm server.pass.key
openssl req -new -key server.key -out server.csr
openssl x509 -req -days 30 -in server.csr -signkey server.key -out server.crt
@vandorjw
Copy link
Author

This will create a self-signed public-private key pair.

It is only good for 30days. I strongly discourage using this on a production server as all your users will see the message "This connection is untrusted". However for testing/development it works great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment