aboutsummaryrefslogtreecommitdiffstats
path: root/csit.infra.dash/do_certs.sh
diff options
context:
space:
mode:
authorpmikus <peter.mikus@protonmail.ch>2022-11-16 14:36:35 +0000
committerPeter Mikus <peter.mikus@protonmail.ch>2022-11-23 13:41:06 +0000
commitd9ff3e50ecf60dbc1255f5d4b11b9111c43cc8ef (patch)
tree61c4c75c690006021fdff70c5819f394b87e1e90 /csit.infra.dash/do_certs.sh
parent20b64f8ed040b3b25c37d71fc8feed28b9a557fd (diff)
feat(cdash): Local data
Signed-off-by: pmikus <peter.mikus@protonmail.ch> Change-Id: I25aa1d124c0a4fd039211054e599e542294a4b5d
Diffstat (limited to 'csit.infra.dash/do_certs.sh')
-rwxr-xr-xcsit.infra.dash/do_certs.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/csit.infra.dash/do_certs.sh b/csit.infra.dash/do_certs.sh
new file mode 100755
index 0000000000..f20ddbc5ef
--- /dev/null
+++ b/csit.infra.dash/do_certs.sh
@@ -0,0 +1,28 @@
+#!/usr/bin/env bash
+
+mkdir -p ./nginx/ssl
+cd ./nginx/ssl
+
+FILE_NAME="subdomains.amazonaws.com"
+
+openssl genrsa -des3 -out CA.key 2048
+
+openssl req -x509 -new -nodes -key CA.key -sha256 -days 8000 -out CA.pem
+
+openssl x509 -in CA.pem -inform PEM -out CA.crt
+
+openssl genrsa -out $FILE_NAME.key 2048
+openssl req -new -key $FILE_NAME.key -out $FILE_NAME.csr
+
+cat > $FILE_NAME.ext << EOF
+authorityKeyIdentifier=keyid,issuer
+basicConstraints=CA:FALSE
+keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment
+subjectAltName = @alt_names
+[alt_names]
+DNS.1 = *.amazonaws.com
+DNS.2 = *.us-east-1.amazonaws.com
+DNS.3 = *.s3.amazonaws.com
+EOF
+
+openssl x509 -req -in $FILE_NAME.csr -CA CA.pem -CAkey CA.key -CAcreateserial -out $FILE_NAME.crt -days 8000 -sha256 -extfile $FILE_NAME.ext \ No newline at end of file