Added script to create SSL certificate.

This commit is contained in:
Jan Vidar Krey 2010-01-22 18:22:39 +01:00
parent 68a26e1160
commit 5f353ebe28
1 changed files with 16 additions and 0 deletions

16
tools/create_certificate.sh Executable file
View File

@ -0,0 +1,16 @@
#!/bin/sh
OPENSSL=/usr/bin/openssl
NAME=certificate
if [ ! -x ${OPENSSL} ]; then
echo "Cannot locate the openssl utility: ${OPENSSL}"
exit 1
fi
${OPENSSL} genrsa -out ${NAME}.key 1024 &&
${OPENSSL} req -new -x509 -nodes -sha1 -days 365 -key ${NAME}.key > ${NAME}.crt &&
cat ${NAME}.key ${NAME}.crt > ${NAME}.pem && rm -f ${NAME}.key ${NAME}.crt
echo "Created certificate ${NAME}.pem"