-
-
Notifications
You must be signed in to change notification settings - Fork 15k
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
unable to build behind SSL proxy #201189
Comments
Does setting NIX_SSL_CERT_FILE fixes your issue? |
@thufschmitt No, it does not. I have followed the instructions from the link exactly, but the |
Aha, indeed, you're using I'm moving your issue to https://github.com/NixOS/nixpkgs as it's more likely to get a proper answer there if that doesn't work. |
Thanks for the tip. The
So, how do I use the |
This works, in the sense that it makes the build fail for a lack of a valid certificate.
|
It still does not see the cert file...
... but the file is there
Another problem is that a |
That's what I meant by a quick and dirty solution. A proper solution would add the system certificate bundle inside the build sandbox, and use it when available. But that requires changes to nix. That is also not a problem on other platforms if you use an impure path to specify the bundle. Lots of things to think about, but first let's ensure that we can provide a proper GIT_SSL_CAINFO file. Maybe the format is different ? I wonder why it refuses to use yours 🤔 |
I don't quite understand the part about other platforms and the way to specify the impure path. What platforms do you have in mind? How do you use an impure path on those platforms? The file format seems correct. There is no difference between that file and the file which is used to access the internet outside of nix.
|
I think the issue was that nix copies the symlink to the store, instead of the content of the file. Here is a version that works:
The problem with the platforms is that the system-wide certificates are not always in the same location. So hard-coding the path is not okay. |
Thanks for your help. The observation in my previous comments was wrong. The content of the cert file in the nix store was actually not correct. I was testing with Anyway, your last suggestion works, with minor filename change, to match the actual cert filename Question: When
... where does it look for the certificate files? Another confusion is that the source code actually contains nixpkgs/pkgs/build-support/fetchgit/default.nix Lines 91 to 95 in a110f08
|
Duplicate with issue NixOS/nix#4173 |
@zoranbosnjak It seems the working workaround is to add these lines:
To the This ensures that derivations that are built under the Nix daemon process get the correct environment variables. Source: #3382 (comment) |
nix-build
does not work behing SSL proxy (nix
onubuntu-22.04
).I was given a
company.crt
file which was installed to/etc/ssl/certs
, followed bysudo update-ca-certificates
. Internet connectivity is working correctly, for example:However, it looks like the
nix-build
can not fetch fromhttps
. For example:nix-build myhello.nix
works as expected in the environment without SSL proxy. But in the case of a proxy, I am getting this error:The certificates are fine with
git clone
from the shell:Steps To Reproduce
ubuntu-22.04
, adjust certificates for internet access.nix
, following https://nixos.org/manual/nix/unstable/installation/env-variables.html#nix_ssl_cert_filemyhello.nix
which is fetching something fromhttps
(see above).nix-build myhello.nix
Expected behavior
A
result
link is expected after runningnix-build
, even if running behind proxy.nix-env --version
outputAdditional context
There are already a lot of issues reported on this topic, some are 6 or 7 years old, a lot of them are closed (sorry if it's a duplicate). But I was not able to find any workaround to the problem, despite trying hard with many proposed workarounds.
The text was updated successfully, but these errors were encountered: