158
158
# 2016-11-13 bug fix DOMAIN_KEY_CERT generation (1.82)
159
159
# 2016-11-17 add PREVENT_NON_INTERACTIVE_RENEWAL option (1.83)
160
160
# 2016-12-03 add HTTP_TOKEN_CHECK_WAIT option (1.84)
161
+ # 2016-12-03 bugfix CSR renewal when no SANS and when using MINGW (1.85)
161
162
# ----------------------------------------------------------------------------------------
162
163
163
164
PROGNAME=${0##*/ }
164
- VERSION=" 1.84 "
165
+ VERSION=" 1.85 "
165
166
166
167
# defaults
167
168
CODE_LOCATION=" https://raw.githubusercontent.com/srvrco/getssl/master/getssl"
@@ -419,7 +420,7 @@ create_csr() { # create a csr using a given key (if it doesn't already exist)
419
420
if [[ -s " $csr_file " ]]; then
420
421
debug " domain csr exists at - $csr_file "
421
422
# check all domains in config are in csr
422
- alldomains=$( echo " $DOMAIN ,$SANS " | sed -e ' s/ //g; y/,/\n/' | sort -u)
423
+ alldomains=$( echo " $DOMAIN ,$SANS " | sed -e ' s/ //g; s/,$//; y/,/\n/' | sort -u)
423
424
domains_in_csr=$( openssl req -text -noout -in " $csr_file " \
424
425
| sed -n -e ' s/^ *Subject: .* CN=\([A-Za-z0-9.-]*\).*$/\1/p; /^ *DNS:.../ { s/ *DNS://g; y/,/\n/; p; }' \
425
426
| sort -u)
@@ -445,7 +446,11 @@ create_csr() { # create a csr using a given key (if it doesn't already exist)
445
446
tmp_conf=$( mktemp)
446
447
cat " $SSLCONF " > " $tmp_conf "
447
448
printf " [SAN]\n%s" " $SANLIST " >> " $tmp_conf "
448
- openssl req -new -sha256 -key " $csr_key " -subj " /" -reqexts SAN -config " $tmp_conf " > " $csr_file "
449
+ if [[ " $os " == " mingw" ]]; then
450
+ openssl req -new -sha256 -key " $csr_key " -subj " //" -reqexts SAN -config " $tmp_conf " > " $csr_file "
451
+ else
452
+ openssl req -new -sha256 -key " $csr_key " -subj " /" -reqexts SAN -config " $tmp_conf " > " $csr_file "
453
+ fi
449
454
rm -f " $tmp_conf "
450
455
fi
451
456
}
@@ -631,6 +636,8 @@ get_os() { # function to get the current Operating System
631
636
os=" mac"
632
637
elif [[ ${uname_res: 0: 6} == " CYGWIN" ]]; then
633
638
os=" cygwin"
639
+ elif [[ ${uname_res: 0: 6} == " MINGW" ]]; then
640
+ os=" mingw"
634
641
else
635
642
os=" unknown"
636
643
fi
0 commit comments