fix: Update to use UTC time for cert expiry and ignore verification errors
All checks were successful
Build Docker / Build Image (push) Successful in 45s

This commit is contained in:
Nathan Woodburn 2025-02-01 18:36:26 +11:00
parent 2e743528d4
commit f1828d39a7
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1

View File

@ -9,6 +9,9 @@ import dns.asyncresolver
import httpx
from requests_doh import DNSOverHTTPSSession, add_dns_provider
import requests
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) # Disable insecure request warnings (since we are manually verifying the certificate)
def hip2(domain: str):
domain_check = False
@ -75,9 +78,9 @@ def hip2(domain: str):
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 "Hip2: Certificate is expired"