From 5f353ebe280b41e73c479c12524e3532cf59e055 Mon Sep 17 00:00:00 2001 From: Jan Vidar Krey Date: Fri, 22 Jan 2010 18:22:39 +0100 Subject: [PATCH] Added script to create SSL certificate. --- tools/create_certificate.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 tools/create_certificate.sh diff --git a/tools/create_certificate.sh b/tools/create_certificate.sh new file mode 100755 index 0000000..7d13410 --- /dev/null +++ b/tools/create_certificate.sh @@ -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" +