comparison mercurial/url.py @ 29248:e6de6ef3e426

sslutil: remove ui from sslkwargs (API) Arguments to sslutil.wrapsocket() are partially determined by calling sslutil.sslkwargs(). This function receives a ui and a hostname and determines what settings, if any, need to be applied when the socket is wrapped. Both the ui and hostname are passed into wrapsocket(). The other arguments to wrapsocket() provided by sslkwargs() (ca_certs and cert_reqs) are not looked at or modified anywhere outside of sslutil.py. So, sslkwargs() doesn't need to exist as a separate public API called before wrapsocket(). This commit starts the process of removing external consumers of sslkwargs() by removing the "ui" key/argument from its return. All callers now pass the ui argument explicitly.
author Gregory Szorc <gregory.szorc@gmail.com>
date Wed, 25 May 2016 19:43:22 -0700
parents dffe78d80a6c
children f1fe92c6c03c
comparison
equal deleted inserted replaced
29247:3e438497edca 29248:e6de6ef3e426
352 host = self.host 352 host = self.host
353 if self.realhostport: # use CONNECT proxy 353 if self.realhostport: # use CONNECT proxy
354 _generic_proxytunnel(self) 354 _generic_proxytunnel(self)
355 host = self.realhostport.rsplit(':', 1)[0] 355 host = self.realhostport.rsplit(':', 1)[0]
356 self.sock = sslutil.wrapsocket( 356 self.sock = sslutil.wrapsocket(
357 self.sock, self.key_file, self.cert_file, serverhostname=host, 357 self.sock, self.key_file, self.cert_file, ui=self.ui,
358 **sslutil.sslkwargs(self.ui, host)) 358 serverhostname=host, **sslutil.sslkwargs(self.ui, host))
359 sslutil.validatesocket(self.sock) 359 sslutil.validatesocket(self.sock)
360 360
361 class httpshandler(keepalive.KeepAliveHandler, urlreq.httpshandler): 361 class httpshandler(keepalive.KeepAliveHandler, urlreq.httpshandler):
362 def __init__(self, ui): 362 def __init__(self, ui):
363 keepalive.KeepAliveHandler.__init__(self) 363 keepalive.KeepAliveHandler.__init__(self)