Skip to content

Commit 1943149

Browse files
committed
upgrade getssl to 2.11
1 parent e196679 commit 1943149

File tree

1 file changed

+20
-12
lines changed

1 file changed

+20
-12
lines changed

files/getssl.sh

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
# 2016-05-04 Improve check for if DNS_DEL_COMMAND is blank. (0.31)
5151
# 2016-05-06 Setting umask to 077 for security of private keys etc. (0.32)
5252
# 2016-05-20 update to reflect changes in staging ACME server json (0.33)
53-
# 2016-05-20 tidying up checking of json following AMCE changes. (0.34)
53+
# 2016-05-20 tidying up checking of json following ACME changes. (0.34)
5454
# 2016-05-21 added AUTH_DNS_SERVER to getssl.cfg as optional definition of authoritative DNS server (0.35)
5555
# 2016-05-21 added DNS_WAIT to getssl.cfg as (default = 10 seconds as before) (0.36)
5656
# 2016-05-21 added PUBLIC_DNS_SERVER option, for forcing use of an external DNS server (0.37)
@@ -114,20 +114,20 @@
114114
# 2016-09-27 added additional debug info issue #119 (1.47)
115115
# 2016-09-27 removed IPv6 switch in favour of checking both IPv4 and IPv6 (1.48)
116116
# 2016-09-28 Add -Q, or --mute, switch to mute notifications about successfully upgrading getssl (1.49)
117-
# 2016-09-30 improved portability to work natively on FreeBSD, Slackware and OSX (1.50)
117+
# 2016-09-30 improved portability to work natively on FreeBSD, Slackware and Mac OS X (1.50)
118118
# 2016-09-30 comment out PRIVATE_KEY_ALG from the domain template Issue #125 (1.51)
119119
# 2016-10-03 check remote certificate for right domain before saving to local (1.52)
120120
# 2016-10-04 allow existing CSR with domain name in subject (1.53)
121121
# 2016-10-05 improved the check for CSR with domain in subject (1.54)
122122
# 2016-10-06 prints update info on what was included in latest updates (1.55)
123123
# 2016-10-06 when using -a flag, ignore folders in working directory which aren't domains (1.56)
124-
# 2016-10-12 alllow multiple tokens in DNS challenge (1.57)
125-
# 2016-10-14 added CHECK_ALL_AUTH_DNS option to check all DNS servres, not just one primary server (1.58)
124+
# 2016-10-12 allow multiple tokens in DNS challenge (1.57)
125+
# 2016-10-14 added CHECK_ALL_AUTH_DNS option to check all DNS servers, not just one primary server (1.58)
126126
# 2016-10-14 added archive of chain and private key for each cert, and purge old archives (1.59)
127127
# 2016-10-17 updated info comment on failed cert due to rate limits. (1.60)
128128
# 2016-10-17 fix error messages when using 1.0.1e-fips (1.61)
129129
# 2016-10-20 set secure permissions when generating account key (1.62)
130-
# 2016-10-20 set permsissions to 700 for getssl script during upgrade (1.63)
130+
# 2016-10-20 set permissions to 700 for getssl script during upgrade (1.63)
131131
# 2016-10-20 add option to revoke a certificate (1.64)
132132
# 2016-10-21 set revocation server default to acme-v01.api.letsencrypt.org (1.65)
133133
# 2016-10-21 bug fix for revocation on different servers. (1.66)
@@ -184,10 +184,11 @@
184184
# 2017-01-30 issue #243 compatibility with bash 3.0 (2.08)
185185
# 2017-01-30 issue #243 additional compatibility with bash 3.0 (2.09)
186186
# 2017-02-18 add OCSP Must-Staple to the domain csr generation (2.10)
187+
# 2019-09-30 issue #423 Use HTTP 1.1 as workaround atm (2.11)
187188
# ----------------------------------------------------------------------------------------
188189

189190
PROGNAME=${0##*/}
190-
VERSION="2.10"
191+
VERSION="2.11"
191192

192193
# defaults
193194
ACCOUNT_KEY_LENGTH=4096
@@ -245,7 +246,7 @@ ORIGCMD="$0 $*"
245246
# Define all functions (in alphabetical order)
246247

247248
cert_archive() { # Archive certificate file by copying files to dated archive dir.
248-
debug "creating an achive copy of current new certs"
249+
debug "creating an archive copy of current new certs"
249250
date_time=$(date +%Y_%m_%d_%H_%M)
250251
mkdir -p "${DOMAIN_DIR}/archive/${date_time}"
251252
umask 077
@@ -527,7 +528,7 @@ copy_file_to_location() { # copies a file, using scp, sftp or ftp if required.
527528
fi
528529
elif [[ "${to:0:4}" == "ftp:" ]] ; then
529530
if [[ "$cert" != "challenge token" ]] ; then
530-
error_exit "ftp is not a sercure method for copying certificates or keys"
531+
error_exit "ftp is not a secure method for copying certificates or keys"
531532
fi
532533
debug "using ftp to copy the file from $from"
533534
ftpuser=$(echo "$to"| awk -F: '{print $2}')
@@ -676,7 +677,7 @@ date_epoc() { # convert the date into epoch time
676677
date_fmt() { # format date from epoc time to YYYY-MM-DD
677678
if [[ "$os" == "bsd" ]]; then #uses older style date function.
678679
date -j -f "%s" "$1" +%F
679-
elif [[ "$os" == "mac" ]]; then # MAC OSX uses older BSD style date.
680+
elif [[ "$os" == "mac" ]]; then # macOS uses older BSD style date.
680681
date -j -f "%s" "$1" +%F
681682
else
682683
date -d "@$1" +%F
@@ -1135,7 +1136,14 @@ send_signed_request() { # Sends a request to the ACME server, signed with your p
11351136

11361137
CURL_HEADER="$TEMP_DIR/curl.header"
11371138
dp="$TEMP_DIR/curl.dump"
1138-
CURL="curl --silent --dump-header $CURL_HEADER "
1139+
1140+
CURL="curl "
1141+
if [[ "$($CURL -V | head -1 | cut -d' ' -f2 )" > "7.33" ]]; then
1142+
CURL="$CURL --http1.1 "
1143+
fi
1144+
1145+
CURL="$CURL --silent --dump-header $CURL_HEADER "
1146+
11391147
if [[ ${_USE_DEBUG} -eq 1 ]]; then
11401148
CURL="$CURL --trace-ascii $dp "
11411149
fi
@@ -1709,7 +1717,7 @@ if [[ -s "$CERT_FILE" ]]; then
17091717
if [[ $(date_renew) -lt "$enddate_s" ]] && [[ $_FORCE_RENEW -ne 1 ]]; then
17101718
issuer=$(openssl x509 -in "$CERT_FILE" -noout -issuer 2>/dev/null)
17111719
if [[ "$issuer" == *"Fake LE Intermediate"* ]] && [[ "$CA" == "https://acme-v01.api.letsencrypt.org" ]]; then
1712-
debug "upgradeing from fake cert to real"
1720+
debug "upgrading from fake cert to real"
17131721
else
17141722
info "${DOMAIN}: certificate is valid for more than $RENEW_ALLOW days (until $enddate)"
17151723
# everything is OK, so exit.
@@ -1736,7 +1744,7 @@ else
17361744
create_key "$ACCOUNT_KEY_TYPE" "$ACCOUNT_KEY" "$ACCOUNT_KEY_LENGTH"
17371745
fi
17381746

1739-
# if not reusing priavte key, then remove the old keys
1747+
# if not reusing private key, then remove the old keys
17401748
if [[ "$REUSE_PRIVATE_KEY" != "true" ]]; then
17411749
if [[ -s "$DOMAIN_DIR/${DOMAIN}.key" ]]; then
17421750
rm -f "$DOMAIN_DIR/${DOMAIN}.key"

0 commit comments

Comments
 (0)