-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SSL certificate path does not propagate to builds during nix-build
#10783
Comments
I wonder if behavior changes with |
yeah same result, unfortunately |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/nix-build-curl-issues-behind-proxy/45911/5 |
since fetchzip is not a nix builtin but implemented in nixpkgs (based on fetchurl), this issue should perhaps be moved to the nixpkgs repo instead? |
I thought it might also be a Nix (daemon?) issue that it kills |
Hmm, indeed curl in nixpkgs does reference #3155 and https://discourse.nixos.org/t/nix-cannot-find-my-custom-ssl-certificate/27361/5 might also be relevant. |
yeah, I saw those issues and already applied the
|
A workaround when using systemd.services.nix-daemon = {
enable = true;
serviceConfig = {
Environment = [
"NIX_CURL_FLAGS=\"--cacert /etc/ssl/certs/ca-certificates.crt\""
];
};
}; which seems to work in my setup. Still, I think edit: this workaround seems to work with |
Triaged in Nix maintainers meeting:
|
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2024-05-29-nix-team-meeting-minutes-148/46195/1 |
Another hacky workaround is utilize the extra certificate arguments of the nixpkgs.overlays = [
(final: prev: {
cacert = prev.cacert.overrideAttrs (old: {
extraCertificateStrings=[your_certificates];
});
})
]; Since almost everything on your system transitively depends on |
I'm bumping into this issue and I wholeheartedly agree. Currently not running NixOS, but a Nix-based developer environment on Fedora with a custom certificate and I am bumping into the same issue described here. A fix for both NixOS and non-NixOS users would be ideal. |
Describe the bug
Fetchers such as
fetchzip
rely oncurl
which by default will try to verify SSL certificates. When running behind an intercepting proxy,curl
must either be run with--insecure
, or it must be given a certificate bundle containing the self-signed certificate, e.g. through theCURL_CA_BUNDLE
environment variable. It seems this information does not propagate to the build process through the nix daemon.The documentation suggests the path to the SSL certificate bundle should propagate properly when setting
NIX_SSL_CERT_FILE
. I accordingly adjustedenvironment.variables
. Indeed,systemctl show nix-daemon | grep Environment
now shows correct entries forNIX_SSL_CERT_FILE
and evenCURL_CA_BUNDLE
, but the build fails as described below.Steps To Reproduce
security.pki.certificates
CURL_CA_BUNDLE
is set properlyfetchzip
,fetchFromGitHub
, or similar (nofetchTarball
)Expected behavior
Succeeding build.
nix-env --version
outputAdditional context
The fact that the fetchers don't consider system certificates IMO is a bug in itself. They wrongly use
${cacert}/etc/ssl/certs/ca-bundle.crt
which gives rise to this issue in the first place (explanation). Nevertheless,NIX_SSL_CERT_FILE
should still override it.Priorities
Add 👍 to issues you find important.
The text was updated successfully, but these errors were encountered: