Show More
@@ -249,17 +249,22 b' def sslkwargs(ui, host):' | |||
|
249 | 249 | if cacerts == '!': |
|
250 | 250 | return kws |
|
251 | 251 | |
|
252 | # If a value is set in the config, validate against a path and load | |
|
253 | # and require those certs. | |
|
252 | 254 | if cacerts: |
|
253 | 255 | cacerts = util.expandpath(cacerts) |
|
254 | 256 | if not os.path.exists(cacerts): |
|
255 | 257 | raise error.Abort(_('could not find web.cacerts: %s') % cacerts) |
|
256 | else: | |
|
257 | # CA certs aren't explicitly listed in the config. See if we can load | |
|
258 | # defaults. | |
|
259 | cacerts = _defaultcacerts() | |
|
260 | if cacerts and cacerts != '!': | |
|
261 | ui.debug('using %s to enable OS X system CA\n' % cacerts) | |
|
262 | ui.setconfig('web', 'cacerts', cacerts, 'defaultcacerts') | |
|
258 | ||
|
259 | kws.update({'ca_certs': cacerts, | |
|
260 | 'cert_reqs': ssl.CERT_REQUIRED}) | |
|
261 | return kws | |
|
262 | ||
|
263 | # No CAs in config. See if we can load defaults. | |
|
264 | cacerts = _defaultcacerts() | |
|
265 | if cacerts and cacerts != '!': | |
|
266 | ui.debug('using %s to enable OS X system CA\n' % cacerts) | |
|
267 | ui.setconfig('web', 'cacerts', cacerts, 'defaultcacerts') | |
|
263 | 268 | |
|
264 | 269 | if cacerts != '!': |
|
265 | 270 | kws.update({'ca_certs': cacerts, |
General Comments 0
You need to be logged in to leave comments.
Login now