aboutsummaryrefslogtreecommitdiff
path: root/test/init.sh
diff options
context:
space:
mode:
Diffstat (limited to 'test/init.sh')
-rwxr-xr-xtest/init.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/init.sh b/test/init.sh
new file mode 100755
index 0000000..5a8d198
--- /dev/null
+++ b/test/init.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+#
+# Copyright (C) 2021 jahoti <jahoti@tilde.team>
+# Licensing information is collated in the `copyright` file
+
+# Initialize the root certificate for the tests proxy server
+# Make sure this is run in the directory where they will be put!
+
+gen_keys () {
+ while [ -n "$1" ]; do
+ openssl genrsa -out "${1}".key 4096
+ done
+}
+
+if [ -n "$1" ]; then
+ cd "$1"
+fi
+gen_keys ca cert
+openssl req -new -x509 -days ${2:-183} -key ca.key -out ca.crt -subj "/CN=Hachette Test"