diff -urN M2Crypto/M2Crypto/httpslib.py M2Crypto-0.21.1/M2Crypto/httpslib.py --- M2Crypto/M2Crypto/httpslib.py 2012-03-15 03:27:22.181524406 +0100 +++ M2Crypto-0.21.1/M2Crypto/httpslib.py 2012-03-15 03:27:40.467485033 +0100 @@ -182,14 +182,14 @@ else: HTTPSConnection.putheader(self, header, value) - def endheaders(self): + def endheaders(self, *args, **kwargs): # We've recieved all of hte headers. Use the supplied username # and password for authorization, possibly overriding the authstring # supplied in the headers. if not self._proxy_auth: self._proxy_auth = self._encode_auth() - HTTPSConnection.endheaders(self) + HTTPSConnection.endheaders(self, *args, **kwargs) def connect(self): HTTPConnection.connect(self) diff -urN M2Crypto/M2Crypto/m2urllib2.py M2Crypto-0.21.1/M2Crypto/m2urllib2.py --- M2Crypto/M2Crypto/m2urllib2.py 2011-01-15 20:10:05.000000000 +0100 +++ M2Crypto-0.21.1/M2Crypto/m2urllib2.py 2012-03-15 03:27:40.467485033 +0100 @@ -64,8 +64,10 @@ target_host = urlparse.urlparse(full_url)[1] if (target_host != host): + request_uri = urlparse.urldefrag(full_url)[0] h = httpslib.ProxyHTTPSConnection(host = host, ssl_context = self.ctx) else: + request_uri = req.get_selector() h = httpslib.HTTPSConnection(host = host, ssl_context = self.ctx) # End our change h.set_debuglevel(self._debuglevel) @@ -80,7 +82,7 @@ # request. headers["Connection"] = "close" try: - h.request(req.get_method(), req.get_selector(), req.data, headers) + h.request(req.get_method(), request_uri, req.data, headers) r = h.getresponse() except socket.error, err: # XXX what error? raise URLError(err)