Show More
@@ -222,14 +222,13 b' def _plainapplepython():' | |||
|
222 | 222 | exe.startswith('/system/library/frameworks/python.framework/')) |
|
223 | 223 | |
|
224 | 224 | def _defaultcacerts(): |
|
225 |
"""return path to CA certificates |
|
|
225 | """return path to default CA certificates or None.""" | |
|
226 | 226 | if _plainapplepython(): |
|
227 | 227 | dummycert = os.path.join(os.path.dirname(__file__), 'dummycert.pem') |
|
228 | 228 | if os.path.exists(dummycert): |
|
229 | 229 | return dummycert |
|
230 | if _canloaddefaultcerts: | |
|
230 | ||
|
231 | 231 |
|
|
232 | return '!' | |
|
233 | 232 | |
|
234 | 233 | def sslkwargs(ui, host): |
|
235 | 234 | """Determine arguments to pass to wrapsocket(). |
@@ -262,8 +261,12 b' def sslkwargs(ui, host):' | |||
|
262 | 261 | |
|
263 | 262 | # No CAs in config. See if we can load defaults. |
|
264 | 263 | cacerts = _defaultcacerts() |
|
265 |
if cacerts |
|
|
264 | if cacerts: | |
|
266 | 265 | ui.debug('using %s to enable OS X system CA\n' % cacerts) |
|
266 | else: | |
|
267 | if not _canloaddefaultcerts: | |
|
268 | cacerts = '!' | |
|
269 | ||
|
267 | 270 | ui.setconfig('web', 'cacerts', cacerts, 'defaultcacerts') |
|
268 | 271 | |
|
269 | 272 | if cacerts != '!': |
@@ -416,7 +416,7 b' def has_sslcontext():' | |||
|
416 | 416 | @check("defaultcacerts", "can verify SSL certs by system's CA certs store") |
|
417 | 417 | def has_defaultcacerts(): |
|
418 | 418 | from mercurial import sslutil |
|
419 |
return sslutil._defaultcacerts() |
|
|
419 | return sslutil._defaultcacerts() or sslutil._canloaddefaultcerts | |
|
420 | 420 | |
|
421 | 421 | @check("windows", "Windows") |
|
422 | 422 | def has_windows(): |
General Comments 0
You need to be logged in to leave comments.
Login now