summaryrefslogtreecommitdiff
path: root/setuptools/ssl_support.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2016-09-27 14:24:22 -0500
committerJason R. Coombs <jaraco@jaraco.com>2016-09-27 14:24:22 -0500
commit66a6724da8eda3336643dee086da2a3495e6422a (patch)
tree64043e9782491bde3a3a9ae2314cc59451a6c9c0 /setuptools/ssl_support.py
parentdf3905616933c90af95e99f705b800a2f5c1c921 (diff)
parent35ea365b50bd1a64375fdbcce187affab22af3b7 (diff)
downloadpython-setuptools-git-setuptools-scm.tar.gz
Merge with mastersetuptools-scm
Diffstat (limited to 'setuptools/ssl_support.py')
-rw-r--r--setuptools/ssl_support.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/setuptools/ssl_support.py b/setuptools/ssl_support.py
index 657197cf..f4ba8a92 100644
--- a/setuptools/ssl_support.py
+++ b/setuptools/ssl_support.py
@@ -161,6 +161,7 @@ class VerifyingHTTPSHandler(HTTPSHandler):
class VerifyingHTTPSConn(HTTPSConnection):
"""Simple verifying connection: no auth, subclasses, timeouts, etc."""
+
def __init__(self, host, ca_bundle, **kw):
HTTPSConnection.__init__(self, host, **kw)
self.ca_bundle = ca_bundle
@@ -192,6 +193,7 @@ class VerifyingHTTPSConn(HTTPSConnection):
self.sock.close()
raise
+
def opener_for(ca_bundle=None):
"""Get a urlopen() replacement that uses ca_bundle for verification"""
return urllib.request.build_opener(
@@ -201,6 +203,7 @@ def opener_for(ca_bundle=None):
_wincerts = None
+
def get_win_certfile():
global _wincerts
if _wincerts is not None:
@@ -212,6 +215,7 @@ def get_win_certfile():
return None
class MyCertFile(CertFile):
+
def __init__(self, stores=(), certs=()):
CertFile.__init__(self)
for store in stores:
@@ -231,7 +235,7 @@ def get_win_certfile():
def find_ca_bundle():
"""Return an existing CA bundle path, or None"""
- if os.name=='nt':
+ if os.name == 'nt':
return get_win_certfile()
else:
for cert_path in cert_paths: