diff options
| author | Seth Michael Larson <sethmichaellarson@gmail.com> | 2020-11-12 15:35:47 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-12 15:35:47 -0600 |
| commit | b3be378041236b5bccb14ed11e6e3941e6884cbe (patch) | |
| tree | b7d19f890aabb20a899bc4911236a158a5752950 /src | |
| parent | 6611153650b697d56f14be347946f4a814d7fc72 (diff) | |
| download | urllib3-b3be378041236b5bccb14ed11e6e3941e6884cbe.tar.gz | |
Import features from ssl module with more granularity
Diffstat (limited to 'src')
| -rw-r--r-- | src/urllib3/util/ssl_.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/urllib3/util/ssl_.py b/src/urllib3/util/ssl_.py index 8a1c5675..e4b5df70 100644 --- a/src/urllib3/util/ssl_.py +++ b/src/urllib3/util/ssl_.py @@ -44,13 +44,21 @@ _const_compare_digest = getattr(hmac, "compare_digest", _const_compare_digest_ba try: # Test for SSL features import ssl - from ssl import HAS_SNI # Has SNI? from ssl import CERT_REQUIRED, wrap_socket +except ImportError: + pass + +try: + from ssl import HAS_SNI # Has SNI? +except ImportError: + pass +try: from .ssltransport import SSLTransport except ImportError: pass + try: # Platform-specific: Python 3.6 from ssl import PROTOCOL_TLS |
