Skip to content

Commit

Permalink
Support all platforms
Browse files Browse the repository at this point in the history
Signed-off-by: Julien Jerphanion <[email protected]>
  • Loading branch information
jjerphan committed Jan 23, 2025
1 parent 6c85cbb commit 7205e24
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions libmamba/src/download/downloader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,23 @@ namespace mamba::download
namespace
{

constexpr std::array<const char*, 6> cert_locations{
constexpr std::array<const char*, 14> cert_locations{
"/etc/ssl/certs/ca-certificates.crt", // Debian/Ubuntu/Gentoo etc.
"/etc/pki/tls/certs/ca-bundle.crt", // Fedora/RHEL 6
"/etc/ssl/ca-bundle.pem", // OpenSUSE
"/etc/pki/tls/cacert.pem", // OpenELEC
"/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem", // CentOS/RHEL 7
"/etc/ssl/cert.pem", // Alpine Linux
// MacOS
"/System/Library/OpenSSL/certs/cert.pem",
"/usr/local/etc/openssl/cert.pem",
"/usr/local/share/certs/ca-root-nss.crt",
"/usr/local/share/certs/ca-root.crt",
// Windows
"C:/Program Files/Common Files/SSL/certs/ca-bundle.crt",
"C:/Program Files/Common Files/SSL/certs/ca-bundle.trust.crt",
"C:/Program Files/Common Files/SSL/certs/ca-bundle.pem",
"C:/Program Files/Common Files/SSL/certs/ca-bundle.crt"
};

void init_remote_fetch_params(Context::RemoteFetchParams& remote_fetch_params)
Expand Down Expand Up @@ -75,7 +85,9 @@ namespace mamba::download
LOG_INFO << "Using REQUESTS_CA_BUNDLE " << remote_fetch_params.ssl_verify;
}
}
else if (remote_fetch_params.ssl_verify == "<system>" && util::on_linux)
// TODO: Adapt the semantic of `<system>` to decouple the use of CA certificates
// from `conda-forge::ca-certificates` and the system CA certificates.
else if (remote_fetch_params.ssl_verify == "<system>")
{
// Use the CA certificates from `conda-forge::ca-certificates` installed in the
// root prefix or the system CA certificates if the certificate is not present.
Expand Down

0 comments on commit 7205e24

Please sign in to comment.