]> TLD Linux GIT Repositories - tld-builder.git/commitdiff
- script for generating request handler server certificate
authorMarcin Krol <hawk@tld-linux.org>
Thu, 28 Jul 2016 14:12:37 +0000 (14:12 +0000)
committerMarcin Krol <hawk@tld-linux.org>
Thu, 28 Jul 2016 14:12:37 +0000 (14:12 +0000)
admin/gen-cert.sh [new file with mode: 0755]

diff --git a/admin/gen-cert.sh b/admin/gen-cert.sh
new file mode 100755 (executable)
index 0000000..6cb96c1
--- /dev/null
@@ -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 \
+  <<EOF
+.
+.
+.
+TLD Linux
+.
+Build Request Server
+admins@tld-linux.org
+EOF
+
+openssl x509 -in $BUILDERPATH/config/request-server.crt \
+  -noout -text -nameopt sep_multiline