equal
deleted
inserted
replaced
246 def http_open(self, req): |
246 def http_open(self, req): |
247 if urllibcompat.getfullurl(req).startswith('https'): |
247 if urllibcompat.getfullurl(req).startswith('https'): |
248 return self.https_open(req) |
248 return self.https_open(req) |
249 def makehttpcon(*args, **kwargs): |
249 def makehttpcon(*args, **kwargs): |
250 k2 = dict(kwargs) |
250 k2 = dict(kwargs) |
251 k2['use_ssl'] = False |
251 k2[r'use_ssl'] = False |
252 return HTTPConnection(*args, **k2) |
252 return HTTPConnection(*args, **k2) |
253 return self.do_open(makehttpcon, req, False) |
253 return self.do_open(makehttpcon, req, False) |
254 |
254 |
255 def https_open(self, req): |
255 def https_open(self, req): |
256 # urllibcompat.getfullurl(req) does not contain credentials and we may |
256 # urllibcompat.getfullurl(req) does not contain credentials and we may |
286 host, port = host.rsplit(':', 1) |
286 host, port = host.rsplit(':', 1) |
287 port = int(port) |
287 port = int(port) |
288 if '[' in host: |
288 if '[' in host: |
289 host = host[1:-1] |
289 host = host[1:-1] |
290 |
290 |
291 kwargs['keyfile'] = keyfile |
291 kwargs[r'keyfile'] = keyfile |
292 kwargs['certfile'] = certfile |
292 kwargs[r'certfile'] = certfile |
293 |
293 |
294 con = HTTPConnection(host, port, use_ssl=True, |
294 con = HTTPConnection(host, port, use_ssl=True, |
295 ssl_wrap_socket=sslutil.wrapsocket, |
295 ssl_wrap_socket=sslutil.wrapsocket, |
296 ssl_validator=sslutil.validatesocket, |
296 ssl_validator=sslutil.validatesocket, |
297 ui=self.ui, |
297 ui=self.ui, |