launchpad proxy support

Vincent Ladeuil v.ladeuil+lp at free.fr
Fri Oct 30 18:02:55 GMT 2009


>>>>> "Gordon" == Gordon Tyler <gordon at doxxx.net> writes:

    Gordon> Vincent Ladeuil wrote:
    >> Can you attach the relevant part of you .bzr.log ? Watch for
    >> authentication info and anonymize as you see fit.

    Gordon> 0.219  * About to connect() to localhost:3128(proxy for
    Gordon> xmlrpc.edge.launchpad.net)
    Gordon> 0.234  > CONNECT xmlrpc.edge.launchpad.net
    Gordon> <SNIP HEADERS>
    Gordon> 0.250  < HTTP/1.1 502 Proxy Error ( The parameter is incorrect.  )
    Gordon> <SNIP HEADERS>

Argh ! Gimme the headers ! :-)

    Gordon> CNTLM is running on my local machine using port 3128. It's
    Gordon> configured with my domain username and password for our corporate
    Gordon> network and it works perfectly for my web browser and other
    Gordon> applications accessing https URLs.

    Gordon> Here is what I see in CNTLM's log output for the above:

    Gordon> HEAD: CONNECT xmlrpc.edge.launchpad.net HTTP/1.1

    Gordon> And this is what I see when loading "https://lauchpad.net/" in my
    Gordon> web browser through CNTLM:

    Gordon> HEAD: CONNECT launchpad.net:443 HTTP/1.1

    Gordon> Notice that the browser explicitly uses port 443 in its CONNECT
    Gordon> request for the https URL.

Yeah, I see that, I'm still surprised it's mandatory.

    Gordon> e.g. CONNECT xmlrpc.edge.launchpad.net
    >> 
    Gordon> This means that the proxy connects to port 80, gives
    Gordon> this connection back and then the _urllib2_wrappers
    Gordon> code tries to talk SSL to it and fails.
    >> 
    >> Soubds like a proxy bug to me....but let's see what we can do.

    Gordon> I've tried two different proxies with the same or similar
    Gordon> result. I doubt that they both have exactly the same bug.

    Gordon> How is the proxy supposed to know what port to connect to if you
    Gordon> don't tell it?

We can ask the reverse question: how come some proxies connect
successfully without the port explicitly mentioned ?

I.e. on jaunty I see that same 'CONNECT
xmlrpc.edge.launchpad.net' without port and the connection
succeeds...

But anyway, those are just debug outputs they can lie :-)

<snip/>

    Gordon> I was working under the assumption that the
    Gordon> _urllib_wrappers stuff is supposed to be generic. It
    Gordon> can't assume what port to use unless none is
    Gordon> specified in the original URL.

That's correct, we rely on httplib handling that for us, the port
can stay None until connection time, at which point it uses the
default value for the protocol used, which is defined as an
attribute of the class handling the connection (down to httplib
if you want to look). One can 

There is a hole here though as we need to establish the port
*before* we attempt to connect :-/

I now understand the intent of that controversial code, I've just
pushed the equivalent fix, can you retry ?

       Vincent



More information about the bazaar mailing list