chore: remove unwanted code, fix type issues and comments

This commit is contained in:
Akash Mondal
2025-08-31 13:15:51 +00:00
parent e1141ee376
commit 186113968e
6 changed files with 42 additions and 52 deletions

View File

@ -778,6 +778,16 @@ class PeerAuthenticator:
"""
try:
from datetime import datetime, timezone
now = datetime.now(timezone.utc)
if certificate.not_valid_after_utc < now:
raise QUICPeerVerificationError("Certificate has expired")
if certificate.not_valid_before_utc > now:
raise QUICPeerVerificationError("Certificate not yet valid")
# Extract libp2p extension
libp2p_extension = None
for extension in certificate.extensions: