Mercurial > public > mercurial-scm > hg-stable
diff mercurial/url.py @ 13544:66d65bccbf06 stable
cacert: improve error report when web.cacert file does not exist
author | timeless <timeless@gmail.com> |
---|---|
date | Sun, 06 Mar 2011 10:27:07 -0600 |
parents | 08f9c587141f |
children | 4e8f2310f310 a3403d5b0af3 |
line wrap: on
line diff
--- a/mercurial/url.py Sun Mar 06 05:56:59 2011 -0600 +++ b/mercurial/url.py Sun Mar 06 10:27:07 2011 -0600 @@ -560,9 +560,13 @@ hostfingerprint = self.ui.config('hostfingerprints', host) if cacerts and not hostfingerprint: + cacerts = util.expandpath(cacerts) + if not os.path.exists(cacerts): + raise util.Abort(_('could not find ' + 'web.cacerts: %s') % cacerts) self.sock = _ssl_wrap_socket(self.sock, self.key_file, self.cert_file, cert_reqs=CERT_REQUIRED, - ca_certs=util.expandpath(cacerts)) + ca_certs=cacerts) msg = _verifycert(self.sock.getpeercert(), host) if msg: raise util.Abort(_('%s certificate error: %s '