File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1018,7 +1018,19 @@ _checkcert() {
10181018# file
10191019_enddate () {
10201020 _cf=" $1 "
1021- ${ACME_OPENSSL_BIN:- openssl} x509 -noout -enddate -in " $_cf " | cut -d = -f 2
1021+ _res=" $( ${ACME_OPENSSL_BIN:- openssl} x509 -noout -enddate -in " $_cf " ) "
1022+ if [ " $? " != " 0" ] || [ -z " $_res " ]; then
1023+ return 1
1024+ fi
1025+
1026+ case " $_res " in
1027+ notAfter=* )
1028+ echo " ${_res# notAfter=} "
1029+ ;;
1030+ * )
1031+ return 1
1032+ ;;
1033+ esac
10221034}
10231035
10241036# Usage: hashalg [outputhex]
@@ -5631,7 +5643,16 @@ $_authorizations_map"
56315643 fi
56325644 elif [ " $Le_RenewalDays " -lt " 0" ]; then
56335645 _enddate_value=$( _enddate " $CERT_PATH " )
5646+ if [ " $? " != " 0" ] || [ -z " $_enddate_value " ]; then
5647+ _err " Failed to get certificate end date for $CERT_PATH "
5648+ return 1
5649+ fi
5650+
56345651 _endtime=$( _ssldate2time " $_enddate_value " )
5652+ if [ " $? " != " 0" ] || [ -z " $_endtime " ]; then
5653+ _err " Cannot parse _enddate_value: $_enddate_value "
5654+ return 1
5655+ fi
56355656 Le_NextRenewTime=$( _math " $_endtime " + " $Le_RenewalDays " \* 24 \* 60 \* 60)
56365657 Le_NextRenewTimeStr=$( _time2str " $Le_NextRenewTime " )
56375658 else
You can’t perform that action at this time.
0 commit comments