Add certs.pem in cert probe list

It turns out that some distributions use /etc/ssl/certs.pem, which was causing some troubles.
Related issue https://github.com/rust-lang/cargo/issues/1978#issuecomment-147515236
This commit is contained in:
radare 2015-10-12 23:20:33 +02:00
parent aad933e507
commit 3ca5ecac74
1 changed files with 8 additions and 4 deletions

View File

@ -57,10 +57,14 @@ pub fn probe() -> ProbeResult {
for certs_dir in find_certs_dirs().iter() { for certs_dir in find_certs_dirs().iter() {
// cert.pem looks to be an openssl 1.0.1 thing, while // cert.pem looks to be an openssl 1.0.1 thing, while
// certs/ca-certificates.crt appears to be a 0.9.8 thing // certs/ca-certificates.crt appears to be a 0.9.8 thing
try(&mut result.cert_file, certs_dir.join("cert.pem")); for cert in [
try(&mut result.cert_file, certs_dir.join("certs/ca-certificates.crt")); "cert.pem",
try(&mut result.cert_file, certs_dir.join("certs/ca-root-nss.crt")); "certs.pem",
"certs/ca-certificates.crt",
"certs/ca-root-nss.crt"
].iter() {
try(&mut result.cert_file, certs_dir.join(cert));
}
try(&mut result.cert_dir, certs_dir.join("certs")); try(&mut result.cert_dir, certs_dir.join("certs"));
} }
result result