Setting ssl-cert-file is not enough to pass custom cacerts #1071
Labels
No labels
Affects/CppNix
Affects/Nightly
Affects/Only nightly
Affects/Stable
Area/build-packaging
Area/cli
Area/evaluator
Area/fetching
Area/flakes
Area/language
Area/lix ci
Area/nix-eval-jobs
Area/profiles
Area/protocol
Area/releng
Area/remote-builds
Area/repl
Area/repl/debugger
Area/store
awaiting
author
awaiting
contributors
bug
Context
contributors
Context
drive-by
Context
maintainers
Context
RFD
crash 💥
Cross Compilation
devx
docs
Downstream Dependents
E/easy
E/hard
E/help wanted
E/reproducible
E/requires rearchitecture
Feature/S3
imported
Language/Bash
Language/C++
Language/NixLang
Language/Python
Language/Rust
Needs Langver
OS/Linux
OS/macOS
performance
regression
release-blocker
stability
Status
blocked
Status
invalid
Status
postponed
Status
wontfix
testing
testing/flakey
Topic/Large Scale Installations
ux
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lix-project/lix#1071
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Describe the bug
I'm using
mitmproxyto observe all fetches a FOD is doing.I read
lix-project/lix@2d0109898a, and only configured the daemon withssl-cert-file.The
ssl-cert-fileis not picked, I also need to runnix-daemon.servicewithNIX_SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt(logicalTargetPathfrom that commit) to get it to work.Steps To Reproduce
Setup is as follows:
Substitute a FOD store path to ensure you have all inputs available locally:
Invoke
mitmproxyin a separate terminal, producing amitm-tuninterface:Do some
ip {rule,route}trickery to route all network requests coming from nixbld users via thattuninterface (double-check your uids):Copy the
mitmproxyca cert to a readable location:Reconfigure your local
nix-daemon.serviceto use it; in my case, Isudo systemctl edit --runtime nix-daemon.service && sudo systemctl restart nix-daemon.service, but editing your NixOS config should work the same:Run the build:
See it getting "stuck" (only a few lines of output, then only a new line every once in a while). Observe how
mitmproxydoesn't show flows, but instead complains about SSL handshake failures.Then edit and restart
nix-daemon.serviceagain, while adddingEnvironment=NIX_SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crtto the service section.Run the build command again, observe how now flows do show up in the
mitmproxywindow, and how the fetches progress through.Expected behavior
I'd expect setting
ssl-cert-fileto be sufficient.nix --versionoutputAdditional context
I tried with nixpkgs checkouts of both
release-25.05(9393af3b506fc38ff805cef7baf912e97d1f4ed3) andrelease-25.11(517bc6ca281d991ad28a322299b285dd47fd9c4f)I also tested with CppNix (2.31.2).
As it doesn't copy
ssl-cert-fileto a well-known location, it needs--option ssl-cert-file /etc/ssl/minica.pem --extra-sandbox-paths /etc/ssl/minica.pemfornix-daemonandEnvironment=NIX_SSL_CERT_FILE=/etc/ssl/minica.pem.Maybe I'm just misreading things, but the release notes in
lix-project/lix@2d0109898adid read likeNIX_SSL_CERT_FILEshould point to/etc/ssl/certs/ca-certificates.crtinside the build without needing to configure Lix' nix-daemon with it.