[PATCH 0 of 1] url: generalise HTTPS proxy handling to accomodate Python changes

Henrik Stuart hg at hstuart.dk
Thu Nov 12 20:42:07 UTC 2009


Hey,

In Python's /maintenance/ release, Python 2.6.3, httplib and urllib2 have had
new functionality put in to support CONNECT capabilities for proxying HTTPS
connections through a HTTP proxy. This has, however, been done in a way that
breaks our CONNECT proxy support. Previously, HTTPS connections made through a
HTTP proxy went through a httpconnection instance (and the httphandler). As of
Python 2.6.3 a _tunnel_host property is set on the Request and the
HTTPSConnection handles this case explicitly in its connect method.

This means that our proxying support now needs to be duplicated between both
httpconnection and httpsconnection, which has caused me to move out a big bunch
of code from httpconnection to url.py's global scope.

I have, to the best of my ability on this short notice (it was reported on IRC
yesterday), tested it in different settings. However, if you are using proxies
with Mercurial and have the means to test it, please do so.

Unless anyone else comes across any issues with this patch, it will go into
crew-stable sometime saturday.

-- 
Kind regards,
  Henrik Stuart


More information about the Mercurial-devel mailing list