Skip to content

Commit c2aefc2

Browse files
authored
PYTHON-5414 Fix "module service_identity has no attribute SICertificateError" when using pyopenssl (#2382)
1 parent 54846cd commit c2aefc2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pymongo/pyopenssl_context.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -420,9 +420,9 @@ def wrap_socket(
420420
pyopenssl.verify_ip_address(ssl_conn, server_hostname)
421421
else:
422422
pyopenssl.verify_hostname(ssl_conn, server_hostname)
423-
except ( # type:ignore[misc]
424-
service_identity.SICertificateError,
425-
service_identity.SIVerificationError,
423+
except (
424+
service_identity.CertificateError,
425+
service_identity.VerificationError,
426426
) as exc:
427427
raise _CertificateError(str(exc)) from None
428428
return ssl_conn

0 commit comments

Comments
 (0)