Comment 14 for bug 558343

Revision history for this message
Robert Collins (lifeless) wrote :

We do the following:
CONNECT to tunnel through the proxy
SSL after that, so wireshark isn't all that helpful.

In the failing method I see:
(Pdb) print proxy._ServerProxy__host
xmlrpc.edge.launchpad.net
(Pdb) proxy._ServerProxy__transport._opener
<bzrlib.transport.http._urllib2_wrappers.Opener object at 0x1e781d0>

Deep in urllib2, in do_request, line 1080, request.has_proxy is False - this is interesting and seems to be due to the urllib2 set_proxy methods behaviour. I'll need to stare harder at this to understand it I think.

and online 1084 is where the wrong Host header is set.

Now, Its my first time looking at this code, but I think the simplest thing up front is to set Host ourselves. The backtrace is:
  /home/robertc/source/baz/pending/working/bzrlib/plugins/launchpad/lp_registration.py(74)request()
-> response = self._opener.open(request)
  /usr/lib/python2.6/urllib2.py(389)open()
-> req = meth(req)
> /usr/lib/python2.6/urllib2.py(1084)do_request_()
-> if not request.has_header('Host'):
(Pdb)

More later, a quick attempt at that hasn't worked.