C3rd
Generating SSL certificates using OpenSSL
Posted: 10 May 2010, 12:56pm - MondayBased on Centos Wiki on HowTo SSL - http://wiki.centos.org/HowTos/Https I simplified the procedure to create a bash script. Here's the code;
Or download the script below... Download: [download id="8"] bash script How to add gencert command to your system:#!/bin/bash umask 077 echo "" if [ $# -eq 0 ] ; then echo $"Usage: `basename $0` <DOMAIN_NAME> [...]" echo "" exit 0 fi for target in $@ ; do keyFile=${target}.key crtFile=${target}.crt csrFile=${target}.csr echo $keyFile echo $crtFile echo $csrFile # Generate private key openssl genrsa -out $keyFile 1024 # Generate CSR openssl req -new -key $keyFile -out $csrFile echo "" echo "Please enter the number of days which SSL Certificate will be valid:" read DAYS echo "" # Generate Self Signed Key openssl x509 -req -days $DAYS -in $csrFile -signkey $keyFile -out $crtFile done
- Download the gencert bash script
- Extract the file
- chmod u+x gencert
- then copy the gencert file to /bin/
- Wallaah! You're done!