Fix broken check for cert expiration time in renew command

Signed-off-by: Xavier Bachelot <xavier@bachelot.org>
This commit is contained in:
Xavier Bachelot 2019-01-28 15:40:13 +01:00
parent c7b8ffb701
commit 6eff1118f8
Failed to extract signature

View File

@ -1006,13 +1006,13 @@ at: $crt_in"
# Check if old cert is expired or expires within 30 days
expire_date=$(
"$EASYRSA_OPENSSL" x509 -in "$crt_in" -noout -enddate |
sed -n 's/^notAfter=//'
sed 's/^notAfter=//'
)
expire_date=$(date -d "$expire_date" +%s)
allow_renew_date=$(date -d '+30day' +%s)
[ "$expire_date" -gt "$allow_renew_date" ] || die "\
[ "$expire_date" -lt "$allow_renew_date" ] || die "\
Certificate expires in more than 30 days.
Renewal not allowed."