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;
#!/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
Or download the script below...
Download: gencert.zip bash script
How to add gencert command to your system:
- Download the gencert bash script
- Extract the file
- chmod u+x gencert
- then copy the gencert file to /bin/
- Wallaah! You're done!
Search
Categories
Related Links
- Apache Web Server
- ASP Immigration Services Ltd.
- CentOS Linux
- Color Scheme Picker
- CSS Button Generator
- Deviant Art Account
- Don Tabaniag - GraphiCult
- Jerson Maglasang Weblog
- Joshua Manlunas
- Mark "mungkey" Vicente
- Matt Arnilo Baluyos
- MySQL
- Paul Labis
- PHP
- PrendStar
- Ridvan Baluyos
- Scott Davies
- SEO Fart XML-RPC Ping Tool
- Stripes Generator
- The Hero
- Ubuntu Linux
- Vim Carlo Nabora (DA)
- Wella Maria Hong
- What is my IP?
- Xavier University - Ateneo de Cagayan
- Zabyer Community