##// END OF EJS Templates
sslutil: further refactor sslkwargs...
Gregory Szorc -
r29106:fe7ebef8 default
parent child Browse files
Show More
@@ -249,13 +249,18 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})
261 return kws
262
263 # No CAs in config. See if we can load defaults.
259 cacerts = _defaultcacerts()
264 cacerts = _defaultcacerts()
260 if cacerts and cacerts != '!':
265 if cacerts and cacerts != '!':
261 ui.debug('using %s to enable OS X system CA\n' % cacerts)
266 ui.debug('using %s to enable OS X system CA\n' % cacerts)
General Comments 0
You need to be logged in to leave comments. Login now