##// END OF EJS Templates
ssl: extract function that returns dummycert path on Apple python...
Yuya Nishihara -
r24288:922e087b default
parent child Browse files
Show More
@@ -129,6 +129,13 b' def _plainapplepython():'
129 129 return (exe.startswith('/usr/bin/python') or
130 130 exe.startswith('/system/library/frameworks/python.framework/'))
131 131
132 def _defaultcacerts():
133 if _plainapplepython():
134 dummycert = os.path.join(os.path.dirname(__file__), 'dummycert.pem')
135 if os.path.exists(dummycert):
136 return dummycert
137 return None
138
132 139 def sslkwargs(ui, host):
133 140 kws = {}
134 141 hostfingerprint = ui.config('hostfingerprints', host)
@@ -139,9 +146,9 b' def sslkwargs(ui, host):'
139 146 cacerts = util.expandpath(cacerts)
140 147 if not os.path.exists(cacerts):
141 148 raise util.Abort(_('could not find web.cacerts: %s') % cacerts)
142 elif cacerts is None and _plainapplepython():
143 dummycert = os.path.join(os.path.dirname(__file__), 'dummycert.pem')
144 if os.path.exists(dummycert):
149 elif cacerts is None:
150 dummycert = _defaultcacerts()
151 if dummycert:
145 152 ui.debug('using %s to enable OS X system CA\n' % dummycert)
146 153 ui.setconfig('web', 'cacerts', dummycert, 'dummy')
147 154 cacerts = dummycert
General Comments 0
You need to be logged in to leave comments. Login now