Skip to content

Instantly share code, notes, and snippets.

@virtualstaticvoid
Last active September 26, 2015 05:47
Show Gist options
  • Select an option

  • Save virtualstaticvoid/1048594 to your computer and use it in GitHub Desktop.

Select an option

Save virtualstaticvoid/1048594 to your computer and use it in GitHub Desktop.
Make self-signed SSL certificate for development
#!/bin/bash
# as per http://www.24hourapps.com/2009/02/generate-your-own-free-ssl-certificate.html
# will prompt for passwords and details for certificate creation
# change file name as required
filename=${1:-mycert}
openssl genrsa -des3 -out $filename.key 1024
openssl req -new -key $filename.key -out $filename.csr
cp $filename.key $filename.original.key
openssl rsa -in $filename.original.key -out $filename.key
openssl x509 -req -days 365 -in $filename.csr -signkey $filename.key -out $filename.crt
#!/bin/bash
# as per http://superuser.com/a/226229
# change file name as required
filename=${1:-mycert}
openssl req -new -newkey rsa:4096 -days 365 -nodes -x509 \
-subj "/OU=Development/O=Development/CN=localhost:3000" \
-keyout $filename.key \
-out $filename.crt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment