diff options
Diffstat (limited to 'setuptools/ssl_support.py')
-rw-r--r-- | setuptools/ssl_support.py | 9 |
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 |