fix: Use new not after utc for cert date

This commit is contained in:
Nathan Woodburn 2025-02-01 18:31:07 +11:00
parent c657edd08a
commit 778b32f78c
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1

View File

@ -190,9 +190,9 @@ def https_check(params, authentication):
break
expiry_date = cert_obj.not_valid_after
expiry_date = cert_obj.not_valid_after_utc
# Check if expiry date is past
if expiry_date < datetime.datetime.now():
if expiry_date < datetime.datetime.now(datetime.timezone.utc):
return {"result": "Certificate is expired"}
else:
return {"result": "No certificate found"}