From 8655fb83d4ef4de37f0070c79a31cba3068e8c3a Mon Sep 17 00:00:00 2001 From: Budi Arsana Date: Thu, 9 Apr 2020 10:31:50 +0800 Subject: [PATCH 1/2] Move the output to certificate folder --- .gitignore | 1 + createRootCA.sh | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c00f154 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/certificate diff --git a/createRootCA.sh b/createRootCA.sh index e265c9f..cd882ec 100644 --- a/createRootCA.sh +++ b/createRootCA.sh @@ -1,3 +1,6 @@ #!/usr/bin/env bash -openssl genrsa -des3 -out rootCA.key 2048 -openssl req -x509 -new -nodes -key rootCA.key -sha256 -days 825 -out rootCA.pem +set -e + +mkdir "certificate" +openssl genrsa -des3 -out certificate/rootCA.key 2048 +openssl req -x509 -new -nodes -key certificate/rootCA.key -sha256 -days 825 -out certificate/rootCA.pem From 2512fb5d8ceef18594b282c88042cd5c36c75f94 Mon Sep 17 00:00:00 2001 From: Budi Arsana Date: Thu, 9 Apr 2020 10:37:53 +0800 Subject: [PATCH 2/2] Move the output to certificate folder --- createRootCA.sh | 1 - createSelfSigned.sh | 5 +++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/createRootCA.sh b/createRootCA.sh index cd882ec..9b4df63 100644 --- a/createRootCA.sh +++ b/createRootCA.sh @@ -1,6 +1,5 @@ #!/usr/bin/env bash set -e - mkdir "certificate" openssl genrsa -des3 -out certificate/rootCA.key 2048 openssl req -x509 -new -nodes -key certificate/rootCA.key -sha256 -days 825 -out certificate/rootCA.pem diff --git a/createSelfSigned.sh b/createSelfSigned.sh index 1f7c9f9..db702f8 100644 --- a/createSelfSigned.sh +++ b/createSelfSigned.sh @@ -1,3 +1,4 @@ #!/usr/bin/env bash -openssl req -new -sha256 -nodes -out server.csr -newkey rsa:2048 -keyout server.key -config server.csr.cnf -openssl x509 -req -in server.csr -CA rootCA.pem -CAkey rootCA.key -CAcreateserial -out server.crt -days 825 -sha256 -extfile v3.ext +set -e +openssl req -new -sha256 -nodes -out certificate/server.csr -newkey rsa:2048 -keyout certificate/server.key -config server.csr.cnf +openssl x509 -req -in certificate/server.csr -CA certificate/rootCA.pem -CAkey certificate/rootCA.key -CAcreateserial -out certificate/server.crt -days 825 -sha256 -extfile v3.ext