summaryrefslogtreecommitdiff
path: root/scripts/mkreq
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/mkreq')
-rwxr-xr-xscripts/mkreq21
1 files changed, 21 insertions, 0 deletions
diff --git a/scripts/mkreq b/scripts/mkreq
new file mode 100755
index 0000000..c73d598
--- /dev/null
+++ b/scripts/mkreq
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+mkdir -p $1
+cat>/tmp/mkreq-$$.cf<<EOC
+[ req ]
+default_bits = 4096
+distinguished_name = req_distinguished_name
+req_extensions = req_extensions
+prompt = no
+
+[ req_distinguished_name ]
+C = SE
+O = SUNET
+CN = $1
+
+[ req_extensions ]
+subjectAltName = DNS:$1
+EOC
+
+openssl req -config /tmp/mkreq-$$.cf -new -newkey rsa:4096 -sha1 -keyout $1/$1.key -nodes -out $1/$1.csr
+rm /tmp/mkreq-$$.cf