-
Notifications
You must be signed in to change notification settings - Fork 0
/
create-ca.sh
executable file
·44 lines (39 loc) · 943 Bytes
/
create-ca.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/sh
cd ca
# generate ca
cfssl gencert -initca ca-csr.json | cfssljson -bare ca
# generate server certificate for debug
cd debug
cp ../ca.pem .
cfssl gencert \
-ca=../ca.pem \
-ca-key=../ca-key.pem \
-config=../ca-config.json \
-profile=web-servers \
debug-csr.json | cfssljson -bare debug
openssl verify -CAfile ../ca.pem debug.pem
cd ..
# generate server certificate for the app
cd app
cp ../ca.pem .
cfssl gencert \
-ca=../ca.pem \
-ca-key=../ca-key.pem \
-config=../ca-config.json \
-profile=web-servers \
app-csr.json | cfssljson -bare app
openssl verify -CAfile ../ca.pem app.pem
cd ..
# generate server certificate for keycloak
cd keycloak
cp ../ca.pem .
cfssl gencert \
-ca=../ca.pem \
-ca-key=../ca-key.pem \
-config=../ca-config.json \
-profile=web-servers \
keycloak-csr.json | cfssljson -bare keycloak
openssl verify -CAfile ../ca.pem keycloak.pem
cp keycloak-key.pem tls.key
cp keycloak.pem tls.crt
cd ..