File tree Expand file tree Collapse file tree 1 file changed +20
-5
lines changed
Expand file tree Collapse file tree 1 file changed +20
-5
lines changed Original file line number Diff line number Diff line change @@ -118,6 +118,9 @@ if [ -z "$aliases" ]; then
118118 -batch \
119119 -subj " $subj " \
120120 -key $domain .key \
121+ -reqexts SAN \
122+ -config <( cat $ssl_conf \
123+ <( printf " [SAN]\nsubjectAltName=DNS:$domain " ) ) \
121124 -out $domain .csr > /dev/null 2>&1
122125else
123126 for alias in $( echo $domain ,$aliases | tr ' ,' ' \n' | sort -u) ; do
@@ -144,11 +147,23 @@ else
144147fi
145148
146149# Generate the cert 1 year
147- openssl x509 -r eq -s ha256 \
148- -d ays $DAYS \
149- -in $domain .csr \
150- -s ignkey $domain .key \
151- -o ut $domain .crt > /dev/null 2>&1
150+ if [ -z " $aliases " ]; then
151+ openssl x509 -req -sha256 \
152+ -days $DAYS \
153+ -in $domain .csr \
154+ -signkey $domain .key \
155+ -extfile <( printf " [SAN]\nsubjectAltName=DNS:$domain " ) \
156+ -extensions SAN \
157+ -out $domain .crt > /dev/null 2>&1
158+ else
159+ openssl x509 -req -sha256 \
160+ -days $DAYS \
161+ -in $domain .csr \
162+ -signkey $domain .key \
163+ -extfile <( printf " [SAN]\nsubjectAltName=$dns_aliases " ) \
164+ -extensions SAN \
165+ -out $domain .crt > /dev/null 2>&1
166+ fi
152167
153168# Listing certificates
154169if [ -e " $domain .crt" ]; then
You can’t perform that action at this time.
0 commit comments