diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2013-08-11 08:44:47 -0400 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2013-08-11 08:44:47 -0400 |
commit | ebff930a7530b053c6d058d6213f2673331b350e (patch) | |
tree | 792d039eb6a65dddc052529b75eef288591f7bfe | |
parent | 8a33154bb30c9c0ca193d13d8b8ce3818e045d71 (diff) | |
download | external_python_setuptools-ebff930a7530b053c6d058d6213f2673331b350e.tar.gz external_python_setuptools-ebff930a7530b053c6d058d6213f2673331b350e.tar.bz2 external_python_setuptools-ebff930a7530b053c6d058d6213f2673331b350e.zip |
Restored tunnel (proxy) support in SSL connections. Fixes #52.
-rw-r--r-- | CHANGES.txt | 2 | ||||
-rw-r--r-- | setuptools/ssl_support.py | 6 |
2 files changed, 8 insertions, 0 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index 50310ef2..be1061e9 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -25,6 +25,8 @@ CHANGES install. The script will still fall back to a simple ``urlopen`` on platforms that do not have these tools. * Issue #65: Deprecated the ``Features`` functionality. +* Issue #52: In ``VerifyingHTTPSConn``, handle a tunnelled (proxied) + connection. ----- 0.9.8 diff --git a/setuptools/ssl_support.py b/setuptools/ssl_support.py index f8a780a9..90359b2c 100644 --- a/setuptools/ssl_support.py +++ b/setuptools/ssl_support.py @@ -194,6 +194,12 @@ class VerifyingHTTPSConn(HTTPSConnection): sock = create_connection( (self.host, self.port), getattr(self,'source_address',None) ) + + # Handle the socket if a (proxy) tunnel is present + if hasattr(self, '_tunnel') and getattr(self, '_tunnel_host', None): + self.sock = sock + self._tunnel() + self.sock = ssl.wrap_socket( sock, cert_reqs=ssl.CERT_REQUIRED, ca_certs=self.ca_bundle ) |