Script to generate SSL certificates
I often find myself needing to generate SSL certificates for websites in dev, so I made a small script to automate this, nothing fancy.
#! /bin/bash
openssl genrsa -des3 -out server.key 1024
openssl req -new -key server.key -out server.csr
cp server.key server.key.org
openssl rsa -in server.key.org -out private_nopass.key
openssl x509 -req -days 365 -in server.csr -signkey private_nopass.key -out site.crt
rm server.key.org
rm server.csr
chmod 0600 private_nopass.key
chmod 0600 site.crt
It will leave you with two files, a passphrase free key, and an SSL certificate. Just copy them to wherever your site config is looking.
Written by Gordon Williamson
Related protips
1 Response
Summary of instructions at http://www.akadia.com/services/ssh_test_certificate.html
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Script
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#