Mercurial > public > mercurial-scm > hg-stable
diff 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 |
line wrap: on
line diff
--- a/mercurial/url.py Wed May 25 16:09:07 2016 -0700 +++ b/mercurial/url.py Wed May 25 19:43:22 2016 -0700 @@ -354,8 +354,8 @@ _generic_proxytunnel(self) host = self.realhostport.rsplit(':', 1)[0] self.sock = sslutil.wrapsocket( - self.sock, self.key_file, self.cert_file, serverhostname=host, - **sslutil.sslkwargs(self.ui, host)) + self.sock, self.key_file, self.cert_file, ui=self.ui, + serverhostname=host, **sslutil.sslkwargs(self.ui, host)) sslutil.validatesocket(self.sock) class httpshandler(keepalive.KeepAliveHandler, urlreq.httpshandler):