Mercurial > public > mercurial-scm > hg
comparison mercurial/sslutil.py @ 29111:843df550b465
sslutil: check for ui.insecureconnections in sslkwargs
The end result of this function is the same. We now have a more
explicit return branch.
We still keep the old code looking at web.cacerts=! a few lines
below because we're still setting web.cacerts=! and need to react
to the variable. This will be removed in an upcoming patch.
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Thu, 05 May 2016 00:35:45 -0700 |
parents | 16021d58c5ca |
children | 5edc5acecc83 |
comparison
equal
deleted
inserted
replaced
29110:b197e2aba703 | 29111:843df550b465 |
---|---|
241 # and CA certs don't come into play. | 241 # and CA certs don't come into play. |
242 hostfingerprint = ui.config('hostfingerprints', host) | 242 hostfingerprint = ui.config('hostfingerprints', host) |
243 if hostfingerprint: | 243 if hostfingerprint: |
244 return kws | 244 return kws |
245 | 245 |
246 # dispatch sets web.cacerts=! when --insecure is used. | 246 # The code below sets up CA verification arguments. If --insecure is |
247 # used, we don't take CAs into consideration, so return early. | |
248 if ui.insecureconnections: | |
249 return kws | |
250 | |
247 cacerts = ui.config('web', 'cacerts') | 251 cacerts = ui.config('web', 'cacerts') |
252 # TODO remove check when we stop setting this config. | |
248 if cacerts == '!': | 253 if cacerts == '!': |
249 return kws | 254 return kws |
250 | 255 |
251 # If a value is set in the config, validate against a path and load | 256 # If a value is set in the config, validate against a path and load |
252 # and require those certs. | 257 # and require those certs. |