-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathcertificates.sh
57 lines (50 loc) · 1.61 KB
/
certificates.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
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash -x
if [ "$1" = "run" ]; then
CURRENTDIR=$(pwd)
cd /etc/
git clone https://github.com/OpenVPN/easy-rsa.git
cd /etc/easy-rsa/easyrsa3
./easyrsa init-pki
./easyrsa \
--batch \
--dn-mode=org \
--req-c=PT \
--req-st=Azores \
--req-city="Ponta Delgada" \
--req-org="Entidade Certificadora Nacional" \
--req-ou="Departamento de Certificados" \
--req-cn=www.entacert.pt \
build-ca nopass
./easyrsa \
--batch \
--dn-mode=org \
--req-c=PT \
--req-st=Azores \
--req-city="Ponta Delgada" \
--req-org="ENTA - Escola de Novas Tecnologias" \
--req-ou="Departamento de Informatica" \
--req-cn="*.amazonaws.com" \
--subject-alt-name="DNS:*.amazonaws.com" \
build-server-full amazonaws.com nopass
./easyrsa \
--batch \
--dn-mode=org \
--req-c=PT \
--req-st=Azores \
--req-city="Ponta Delgada" \
--req-org="ENTA - Escola de Novas Tecnologias" \
--req-ou="Departamento de Informatica" \
--req-cn="*.amazonaws.com" \
--subject-alt-name="DNS:*.amazonaws.com" \
build-client-full client.amazonaws.com nopass
./easyrsa --passout=file:$PASSFILE export-p12 client.amazonaws.com
cp pki/ca.crt "${CERTPATH}"/certs/
cp pki/issued/amazonaws.com.crt "${CERTPATH}"/certs/
cp pki/private/amazonaws.com.key "${CERTPATH}"/private/
cp pki/issued/client.amazonaws.com.crt "${CERTPATH}"/certs/
cp pki/private/ca.key "${CERTPATH}"/private/
cp pki/private/client.amazonaws.com.key "${CERTPATH}"/private/
fi