comparison mercurial/sslutil.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 9b07017ba528
children cca59ef27e60
comparison
equal deleted inserted replaced
29247:3e438497edca 29248:e6de6ef3e426
245 def sslkwargs(ui, host): 245 def sslkwargs(ui, host):
246 """Determine arguments to pass to wrapsocket(). 246 """Determine arguments to pass to wrapsocket().
247 247
248 ``host`` is the hostname being connected to. 248 ``host`` is the hostname being connected to.
249 """ 249 """
250 kws = {'ui': ui} 250 kws = {}
251 251
252 # If a host key fingerprint is on file, it is the only thing that matters 252 # If a host key fingerprint is on file, it is the only thing that matters
253 # and CA certs don't come into play. 253 # and CA certs don't come into play.
254 hostfingerprint = ui.config('hostfingerprints', host) 254 hostfingerprint = ui.config('hostfingerprints', host)
255 if hostfingerprint: 255 if hostfingerprint: