Skip to content

Commit c6d028f

Browse files
authored
fix: handles URL exception or SSL verifications errors for both python 3.8 and 3.11 inclusive (#231)
1 parent 97ba99e commit c6d028f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

csep/utils/comcat.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,8 @@ def _search(**newargs):
313313

314314
except URLError as URLe:
315315
# Fails to verify SSL certificate, when there is a hostname mismatch
316-
if isinstance(URLe.reason, ssl.SSLCertVerificationError) and URLe.reason.verify_code == 62:
316+
if (isinstance(URLe.reason, ssl.SSLCertVerificationError) and URLe.reason.verify_code == 62) \
317+
or (isinstance(URLe.reason, ssl.SSLError) and URLe.reason.errno == 5):
317318
try:
318319
context = ssl._create_unverified_context()
319320
fh = request.urlopen(url, timeout=TIMEOUT, context=context)

0 commit comments

Comments
 (0)