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 committed 2019-01-28 23:40:40 +01:00
1 parent 4b3eba59a3
commit b904f0c5d3
1 file changed
+2 -2
+2 -2
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."