catch both SSLError in addition to SSLCertVerificationError as we can't

locally do anything about remote negotiation problems.
Passes pre-commit lint now.
pull/595/head
Osma Ahvenlampi 2023-07-03 15:47:42 +03:00
rodzic f0bc0d8bed
commit defd07944e
2 zmienionych plików z 3 dodań i 2 usunięć

Wyświetl plik

@ -1,10 +1,10 @@
import base64
import json
from ssl import SSLCertVerificationError, SSLError
from typing import Literal, TypedDict, cast
from urllib.parse import urlparse
import httpx
from ssl import SSLError, SSLCertVerificationError
from cryptography.exceptions import InvalidSignature
from cryptography.hazmat.primitives import hashes, serialization
from cryptography.hazmat.primitives.asymmetric import padding, rsa
@ -18,6 +18,7 @@ from pyld import jsonld
from core.ld import format_ld_date
class VerificationError(BaseException):
"""
There was an error with verifying the signature

Wyświetl plik

@ -172,7 +172,7 @@ class Domain(StatorModel):
)
except httpx.HTTPError:
pass
except ssl.SSLCertVerificationError:
except (ssl.SSLCertVerificationError, ssl.SSLError):
return None
else:
try: