Mercurial > hg
diff tests/test-patchbomb-tls.t @ 29449:5b71a8d7f7ff
sslutil: emit warning when no CA certificates loaded
If no CA certificates are loaded, that is almost certainly a/the
reason certificate verification fails when connecting to a server.
The modern ssl module in Python 2.7.9+ provides an API to access
the list of loaded CA certificates. This patch emits a warning
on modern Python when certificate verification fails and there are
no loaded CA certificates.
There is no way to detect the number of loaded CA certificates
unless the modern ssl module is present. Hence the differences
in test output depending on whether modern ssl is available.
It's worth noting that a test which specifies a CA file still
renders this warning. That is because the certificate it is loading
is a x509 client certificate and not a CA certificate. This
test could be updated if anyone is so inclined.
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Wed, 29 Jun 2016 19:43:27 -0700 |
parents | e1778b9c8d53 |
children | 5caa415aa48b |
line wrap: on
line diff
--- a/tests/test-patchbomb-tls.t Wed Jun 29 19:49:39 2016 -0700 +++ b/tests/test-patchbomb-tls.t Wed Jun 29 19:43:27 2016 -0700 @@ -48,6 +48,7 @@ this patch series consists of 1 patches. + (an attempt was made to load CA certificates but none were loaded; see https://mercurial-scm.org/wiki/SecureConnections for how to configure Mercurial to avoid this error) (?i)abort: .*?certificate.verify.failed.* (re) [255] #endif