From b82f959f4e375080d36e4bf5a89f461fdd74121e Mon Sep 17 00:00:00 2001 From: Marcin Krol Date: Thu, 28 Jul 2016 14:12:37 +0000 Subject: [PATCH] - script for generating request handler server certificate --- admin/gen-cert.sh | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100755 admin/gen-cert.sh diff --git a/admin/gen-cert.sh b/admin/gen-cert.sh new file mode 100755 index 0000000..6cb96c1 --- /dev/null +++ b/admin/gen-cert.sh @@ -0,0 +1,39 @@ +#!/bin/sh + +umask 077 + +CONFIG=$HOME/.tldbuilderrc +[ -f "$CONFIG" ] && . $CONFIG +[ -n "$BUILDERPATH" ] || BUILDERPATH="$HOME/tld-builder/" +export BUILDERPATH + +if [ -d "$BUILDERPATH" ]; then + cd "$BUILDERPATH" +else + echo "the $BUILDERPATH directory does not exist" + exit 1 +fi + + +if [ -f "$BUILDERPATH/config/global" ]; then + . $BUILDERPATH/config/global +fi + +echo "Generating self-signed certificate for request handler server" + +openssl req -x509 -nodes -days 3650 \ + -newkey rsa:4096 \ + -keyout $BUILDERPATH/config/request-server.key \ + -out $BUILDERPATH/config/request-server.crt \ + <