Fix broken check for cert expiration time in renew command
Signed-off-by: Xavier Bachelot <xavier@bachelot.org>
This commit is contained in:
parent
4b3eba59a3
commit
b904f0c5d3
@ -1006,13 +1006,13 @@ at: $crt_in"
|
|||||||
# Check if old cert is expired or expires within 30 days
|
# Check if old cert is expired or expires within 30 days
|
||||||
expire_date=$(
|
expire_date=$(
|
||||||
"$EASYRSA_OPENSSL" x509 -in "$crt_in" -noout -enddate |
|
"$EASYRSA_OPENSSL" x509 -in "$crt_in" -noout -enddate |
|
||||||
sed -n 's/^notAfter=//'
|
sed 's/^notAfter=//'
|
||||||
)
|
)
|
||||||
expire_date=$(date -d "$expire_date" +%s)
|
expire_date=$(date -d "$expire_date" +%s)
|
||||||
|
|
||||||
allow_renew_date=$(date -d '+30day' +%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.
|
Certificate expires in more than 30 days.
|
||||||
Renewal not allowed."
|
Renewal not allowed."
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user