bug修复

This commit is contained in:
2026-07-21 11:02:26 +08:00
parent 14899055a4
commit 1d7e7d999c
5 changed files with 51 additions and 27 deletions
+2 -2
View File
@@ -12,7 +12,7 @@ import logging
import subprocess
import tempfile
from pathlib import Path
from datetime import datetime, timedelta
from datetime import datetime, timedelta, timezone
import requests
from cryptography import x509
@@ -326,7 +326,7 @@ class AcmeService:
try:
cert = x509.load_pem_x509_certificate(cert_path.read_bytes())
not_after = cert.not_valid_after_utc
days_left = (not_after - datetime.utcnow()).days
days_left = (not_after - datetime.now(timezone.utc)).days
return days_left <= self.config.renew_days, days_left
except Exception:
return True, 0