|
@@ -6,7 +6,7 @@ openssl genrsa -out /etc/letsencrypt/rootCA.key 4096
|
6
|
6
|
echo generating CA certificate
|
7
|
7
|
openssl req -x509 -new -nodes -sha256 -days 7300 \
|
8
|
8
|
-key /etc/letsencrypt/rootCA.key \
|
9
|
|
- -subj "/C=DE/ST=BW/O={{ domain }}/CN={{ domain }}" \
|
|
9
|
+ -subj "/C=DE/ST=BW/O={{ domain }}/CN={{ server_fqdn }}" \
|
10
|
10
|
-out /etc/letsencrypt/rootCA.crt
|
11
|
11
|
|
12
|
12
|
echo generating server key
|
|
@@ -15,11 +15,16 @@ openssl genrsa -out /etc/letsencrypt/{{ domain }}.key 2048
|
15
|
15
|
echo generating signing request
|
16
|
16
|
openssl req -new -sha256 \
|
17
|
17
|
-key /etc/letsencrypt/{{ domain }}.key \
|
18
|
|
- -subj "/C=DE/ST=BW/O={{ domain }}/CN=*.{{ domain }}" \
|
|
18
|
+ -subj "/C=DE/ST=BW/O={{ domain }}/CN={{ server_fqdn }}" \
|
|
19
|
+ -reqexts SAN \
|
|
20
|
+ -extensions SAN \
|
|
21
|
+ -config <(cat /etc/ssl/openssl.cnf \
|
|
22
|
+ <(printf "\n[SAN]\nsubjectAltName=DNS:{{ server_fqdn }}")) \
|
19
|
23
|
-out /etc/letsencrypt/{{ domain }}.csr
|
20
|
24
|
|
21
|
25
|
echo generating server certificate
|
22
|
26
|
openssl x509 -req -CAcreateserial -days 7300 -sha256 \
|
|
27
|
+ -extfile <(printf "subjectAltName=DNS:{{ server_fqdn }}") \
|
23
|
28
|
-in /etc/letsencrypt/{{ domain }}.csr \
|
24
|
29
|
-CA /etc/letsencrypt/rootCA.crt \
|
25
|
30
|
-CAkey /etc/letsencrypt/rootCA.key \
|