aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/ssl_support.py
diff options
context:
space:
mode:
authorToshio Kuratomi <toshio@fedoraproject.org>2013-10-28 10:43:08 -0700
committerToshio Kuratomi <toshio@fedoraproject.org>2013-10-28 12:42:02 -0700
commitad6bce6ab02836ea6d90e69e5c6f3b851532874a (patch)
treeda37bf550cf1bab62b9f6407cdad36c9ba6d052f /setuptools/ssl_support.py
parent38fcb3e366ee7a21ff5f0f550fe190b1326fc04b (diff)
downloadexternal_python_setuptools-ad6bce6ab02836ea6d90e69e5c6f3b851532874a.tar.gz
external_python_setuptools-ad6bce6ab02836ea6d90e69e5c6f3b851532874a.tar.bz2
external_python_setuptools-ad6bce6ab02836ea6d90e69e5c6f3b851532874a.zip
Look for the backports-ssl_match_hostname module from pypi before using our bundled/backported code
Diffstat (limited to 'setuptools/ssl_support.py')
-rw-r--r--setuptools/ssl_support.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/setuptools/ssl_support.py b/setuptools/ssl_support.py
index 4941d94e..e1cf8040 100644
--- a/setuptools/ssl_support.py
+++ b/setuptools/ssl_support.py
@@ -85,9 +85,18 @@ except ImportError:
try:
from ssl import CertificateError, match_hostname
except ImportError:
+ try:
+ from backports.ssl_match_hostname import CertificateError
+ from backports.ssl_match_hostname import match_hostname
+ except ImportError:
+ CertificateError = None
+ match_hostname = None
+
+if not CertificateError:
class CertificateError(ValueError):
pass
+if not match_hostname:
def _dnsname_match(dn, hostname, max_wildcards=1):
"""Matching according to RFC 6125, section 6.4.3