launchpad proxy support

Gordon Tyler gordon at doxxx.net
Fri Oct 30 16:11:46 GMT 2009


Vincent Ladeuil wrote:
> I didn't touch the wrappers at all (well, except to take into
> account the report_activity problems you noticed).
> 
> Can you give a try at lp:~vila/bzr/186920-lp-proxy and give me
> feedback about whether it fixes the bug for you ?
> 
> I think the problems you encountered may be related to proxy
> redirecting http to https or the reverse, be sure to set
> https_proxy if you want to reach launchpad (or all_proxy) or
> simply because you tried to handle the default port explicitly,
> which we tried, failed, and abandoned in other areas :-)
> 
> I tested locally with tinyproxy on a jaunty host with:
> 
>   https_proxy=http://localhost:8888 ./bzr lp-open -Dhttp lp:bzr

I tested using CNTLM and I get the following:

C:\dev\bzr>bzrdev -Dhttp lp-open lp:bzr
bzr: ERROR: Invalid http response for 
https://xmlrpc.edge.launchpad.net/bazaar/: Unable to handle http code 
502: Proxy Error ( The parameter is incorrect.  )

This is the same problem I encountered earlier (with both CNTLM and 
tinyproxy on two different hosts on two different networks) which I was 
able to diagnose by running CNTLM in verbose foreground mode and 
watching what it logged when the connection was made.

I discovered that the problem is that when _urllib2_wrappers makes the 
CONNECT request to the proxy it does not specify the port number.

e.g. CONNECT xmlrpc.edge.launchpad.net

This means that the proxy connects to port 80, gives this connection 
back and then the _urllib2_wrappers code tries to talk SSL to it and fails.

My fix in _urllib2_wrappers was make Request and _ConnectRequest 
remember what the original port number in the URL was (using the 
scheme's default if not specified in the URL) and then use this 
explicitly in the CONNECT request.

e.g. CONNECT xmlrpc.edge.launchpad.net:443

Ciao,
Gordon



More information about the bazaar mailing list