mirror of
https://github.com/openSUSE/osc.git
synced 2024-12-27 10:16:14 +01:00
- fixed proxy handling (broken by 53361a50f1
)
- this fixes #657958 ("openSUSE:Tools/osc: Bug") - oscssl.myProxyHTTPSConnection: proxy auth works again
This commit is contained in:
parent
0e7074f89c
commit
306507748c
@ -182,8 +182,11 @@ class myHTTPSHandler(M2Crypto.m2urllib2.HTTPSHandler):
|
|||||||
|
|
||||||
if (target_host != host):
|
if (target_host != host):
|
||||||
h = myProxyHTTPSConnection(host = host, appname = self.appname, ssl_context = self.ctx)
|
h = myProxyHTTPSConnection(host = host, appname = self.appname, ssl_context = self.ctx)
|
||||||
|
# M2Crypto.ProxyHTTPSConnection.putrequest expects a fullurl
|
||||||
|
selector = full_url
|
||||||
else:
|
else:
|
||||||
h = myHTTPSConnection(host = host, appname = self.appname, ssl_context = self.ctx)
|
h = myHTTPSConnection(host = host, appname = self.appname, ssl_context = self.ctx)
|
||||||
|
selector = req.get_selector()
|
||||||
# End our change
|
# End our change
|
||||||
h.set_debuglevel(self._debuglevel)
|
h.set_debuglevel(self._debuglevel)
|
||||||
|
|
||||||
@ -197,7 +200,7 @@ class myHTTPSHandler(M2Crypto.m2urllib2.HTTPSHandler):
|
|||||||
# request.
|
# request.
|
||||||
headers["Connection"] = "close"
|
headers["Connection"] = "close"
|
||||||
try:
|
try:
|
||||||
h.request(req.get_method(), req.get_selector(), req.data, headers)
|
h.request(req.get_method(), selector, req.data, headers)
|
||||||
r = h.getresponse()
|
r = h.getresponse()
|
||||||
except socket.error, err: # XXX what error?
|
except socket.error, err: # XXX what error?
|
||||||
err.filename = full_url
|
err.filename = full_url
|
||||||
@ -247,7 +250,7 @@ class myProxyHTTPSConnection(M2Crypto.httpslib.ProxyHTTPSConnection, httplib.HTT
|
|||||||
verify_certificate(self)
|
verify_certificate(self)
|
||||||
|
|
||||||
def endheaders(self, *args, **kwargs):
|
def endheaders(self, *args, **kwargs):
|
||||||
if not self._proxy_auth is None:
|
if self._proxy_auth is None:
|
||||||
self._proxy_auth = self._encode_auth()
|
self._proxy_auth = self._encode_auth()
|
||||||
httplib.HTTPSConnection.endheaders(self, *args, **kwargs)
|
httplib.HTTPSConnection.endheaders(self, *args, **kwargs)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user