Template:Makecert.sh

Linux script to generate custom self signed certificate

makecert.sh:
 * 1) !/bin/sh

if [ "$1" = "" ] ; then echo "Error: Usage: $0 \"[cert-domain]\"" exit 1 fi DOMAIN=$1 if [ "$2" != "" ] ; then CERTDOMAIN=$2 else CERTDOMAIN=$1 fi echo "Creating SSL cert for $DOMAIN ($CERTDOMAIN)"
 * 1) ./makecert.sh

mkdir $1 cd $1 openssl req -new -out $DOMAIN.csr -passout pass:test < $DOMAIN.pem
 * 1) openssl rsa -in privkey.pem -out $DOMAIN.key
 * 1) FYI, pem for chain would be 'key, cert, chain > pem'

See openssl.cnf