aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/globals.cc
diff options
context:
space:
mode:
authorYorick van Pelt <yorick@yorickvanpelt.nl>2023-05-26 15:32:28 +0200
committerYorick van Pelt <yorick@yorickvanpelt.nl>2023-05-26 15:36:47 +0200
commit2c462486fe0c1bcb5b1142507d2875e98b2418df (patch)
tree3910b99966387323f21b464f77f25b2010e915a7 /src/libstore/globals.cc
parenta6c78ba367725a81aa631a7df2d0840ddd25faf5 (diff)
create pathAccessible, use it to infer default dirs
Diffstat (limited to 'src/libstore/globals.cc')
-rw-r--r--src/libstore/globals.cc4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/libstore/globals.cc b/src/libstore/globals.cc
index a196c10e6..32e9a6ea9 100644
--- a/src/libstore/globals.cc
+++ b/src/libstore/globals.cc
@@ -57,8 +57,6 @@ Settings::Settings()
auto sslOverride = getEnv("NIX_SSL_CERT_FILE").value_or(getEnv("SSL_CERT_FILE").value_or(""));
if (sslOverride != "")
caFile = sslOverride;
- else if (caFile == "")
- caFile = getDefaultSSLCertFile();
/* Backwards compatibility. */
auto s = getEnv("NIX_REMOTE_SYSTEMS");
@@ -185,7 +183,7 @@ bool Settings::isWSL1()
Path Settings::getDefaultSSLCertFile()
{
for (auto & fn : {"/etc/ssl/certs/ca-certificates.crt", "/nix/var/nix/profiles/default/etc/ssl/certs/ca-bundle.crt"})
- if (pathExists(fn)) return fn;
+ if (pathAccessible(fn)) return fn;
return "";
}