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