Author nikratio
Recipients BreamoreBoy, brian.curtin, cameron, nikratio, orsenthil
Date 2014-01-08.03:42:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1389152566.59.0.942431422024.issue7776@psf.upfronthosting.co.za>
In-reply-to
Content
Ok, this is a bit of a mess.

Issue #11448 contains a patch for the documentation. But the functionality itself is still not working.

With the (I believe) intended usage, we have:

>>> import http.client
>>> conn = http.client.HTTPSConnection("localhost",8080)
>>> conn.set_tunnel("www.python.org")
>>> conn.request("HEAD","/index.html")

What happens then is this:

- request() calls _send_request(), which calls _put_request()
- _put_request() generates a "Host: localhost:8080" header
- _send_request() calls sendheaders(), calls _send_output()
- _send_output() calls send(), which calls connect()
- connect() connects to localhost:8080 and calls _tunnel()
- _tunnel() sets self.host to www.python.org and establishes the tunnel, but the Host: header has already been generated, and the proxy host name and port is now lost
- The request is send with a wrong Host header
- When calling close() and connect(), connect will now try to connect directly to www.python.org, but attempt to use it as a proxy to tunnel to itself.
History
Date User Action Args
2014-01-08 03:42:46nikratiosetrecipients: + nikratio, orsenthil, cameron, brian.curtin, BreamoreBoy
2014-01-08 03:42:46nikratiosetmessageid: <1389152566.59.0.942431422024.issue7776@psf.upfronthosting.co.za>
2014-01-08 03:42:46nikratiolinkissue7776 messages
2014-01-08 03:42:45nikratiocreate