diff options
author | Stefano Rivera <stefanor@debian.org> | 2015-10-08 13:19:51 -0700 |
---|---|---|
committer | Daniele Tricoli <eriol@mornie.org> | 2015-10-10 03:15:33 +0200 |
commit | 842fd4e9f188f13313124e3750f1c768d319fc34 (patch) | |
tree | e6d2ded81fbec16c2149f7426268425be6260e13 | |
parent | 28953c4c9c5ad7893bd392658016019fbf78088a (diff) | |
download | python-urllib3-842fd4e9f188f13313124e3750f1c768d319fc34.tar python-urllib3-842fd4e9f188f13313124e3750f1c768d319fc34.tar.gz |
Do not use embedded copy of ssl.match_hostname, when possible
The system python has the necessary features backported, since 2.7.8-7 (and
221a1f9155e2, releasing in 2.7.9, upstream). However, alternative python
implementations don't, yet, and urllib3 is used by pip in virtualenvs.
Forwarded: not-needed
Last-Update: 2014-11-18
Patch-Name: 05_avoid-embedded-ssl-match-hostname.patch
-rw-r--r-- | urllib3/packages/__init__.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/urllib3/packages/__init__.py b/urllib3/packages/__init__.py index 37e8351..10a3aa8 100644 --- a/urllib3/packages/__init__.py +++ b/urllib3/packages/__init__.py @@ -1,4 +1,9 @@ from __future__ import absolute_import -from . import ssl_match_hostname - +try: + # cPython >= 2.7.9 has ssl features backported from Python3 + from ssl import CertificateError + del CertificateError + import ssl as ssl_match_hostname +except ImportError: + from . import ssl_match_hostname |