PYTHON-5414 Fix "module service_identity has no attribute SICertificateError" when using pyopenssl (#2382)
This commit is contained in:
parent
54846cd110
commit
c2aefc2eda
@ -420,9 +420,9 @@ class SSLContext:
|
||||
pyopenssl.verify_ip_address(ssl_conn, server_hostname)
|
||||
else:
|
||||
pyopenssl.verify_hostname(ssl_conn, server_hostname)
|
||||
except ( # type:ignore[misc]
|
||||
service_identity.SICertificateError,
|
||||
service_identity.SIVerificationError,
|
||||
except (
|
||||
service_identity.CertificateError,
|
||||
service_identity.VerificationError,
|
||||
) as exc:
|
||||
raise _CertificateError(str(exc)) from None
|
||||
return ssl_conn
|
||||
|
||||
Loading…
Reference in New Issue
Block a user