diff options
author | Seth Michael Larson <sethmichaellarson@gmail.com> | 2020-11-12 15:47:09 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-12 15:47:09 -0600 |
commit | 1db71ae40729c0b5c31e76efb8b3a2efd91ab7c8 (patch) | |
tree | ba8a0bab7dac8be306c4b15313c434306dfeb9c1 | |
parent | 969fd3957a652ebe90bfe60483a478ad8b88f44a (diff) | |
download | urllib3-1db71ae40729c0b5c31e76efb8b3a2efd91ab7c8.tar.gz |
[1.26] Import features from ssl module with more granularity
-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 1cb5e7cd..236aa8e6 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 |