aboutsummaryrefslogtreecommitdiffstats
path: root/test/scripts/generate.sh
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2015-04-19 10:12:15 +1200
committerAldo Cortesi <aldo@nullcube.com>2015-04-19 10:12:15 +1200
commitd8b79e99829d307dd9cd8dc03872c90236ca173f (patch)
tree53932e7d9e4d1ea8e5a81113950a976c7f542c98 /test/scripts/generate.sh
parenta5567094ace40527f912b4e9f90d71635d50eb6d (diff)
downloadmitmproxy-d8b79e99829d307dd9cd8dc03872c90236ca173f.tar.gz
mitmproxy-d8b79e99829d307dd9cd8dc03872c90236ca173f.tar.bz2
mitmproxy-d8b79e99829d307dd9cd8dc03872c90236ca173f.zip
Scripts to reproducibly generate the test certificate
Diffstat (limited to 'test/scripts/generate.sh')
-rwxr-xr-xtest/scripts/generate.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/scripts/generate.sh b/test/scripts/generate.sh
new file mode 100755
index 00000000..eec3077d
--- /dev/null
+++ b/test/scripts/generate.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+if [ ! -f ./private.key ]
+then
+ openssl genrsa -out private.key 3072
+fi
+openssl req \
+ -batch \
+ -new -x509 \
+ -key private.key \
+ -sha256 \
+ -out cert.pem \
+ -days 9999 \
+ -config ./openssl.cnf
+openssl x509 -in cert.pem -text -noout
+cat ./private.key ./cert.pem > testcert.pem
+rm ./private.key ./cert.pem