-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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 fetch Rust/Cargo dependencies through TLS-intercepting proxy #89526
Comments
Related to #82496 |
I marked this as stale due to inactivity. → More info |
still an issue for me! |
I marked this as stale due to inactivity. → More info |
still an issue for me |
Hey all, i may be alone with this issue but i still do not have a good solution for it. Overriding either |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/cannot-fetch-rust-cargo-packages-through-intercepting-proxy/15726/1 |
@makefu https://git.ingolf-wagner.de/palo/nixos-config/src/master/pkgs/navi/default.nix yields a 404 for me FYI. |
If I am understanding this issue correctly, it seems like nixpkgs/pkgs/development/compilers/rust/cargo.nix Lines 34 to 42 in 419513c
|
@efx is there any chance to override just the Today i tried to install https://github.com/Mic92/nur-packages/blob/master/pkgs/vaultwarden_ldap/default.nix behind the intercepting proxy |
@makefu I think you found the solution in the end, right? |
@Mic92 right, i somehow found a solution for the proxying issue, however the intercepting proxy is also messing with the source files when building from source. For reference, this is the solution i came up with: let
fetchCargoTarball = rustPlatform.fetchCargoTarball.override { cargo = cargo.override { cacert = my-cacert;}; };
in
(rustPlatform.buildRustPackage.override { inherit fetchCargoTarball; }) rec {
... this will result in a rebuild of the rustPlatform with the injected cacert file. However it would be great if this would not be necessary in first place and cargo would honor the ca-bundle set via |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/cannot-fetch-rust-cargo-packages-through-intercepting-proxy/15726/3 |
I marked this as stale due to inactivity. → More info |
A easier workaround which doesn't rebuild the cargo: buildRustPackage = rustPlatform.buildRustPackage.override {
fetchCargoTarball = rustPlatform.fetchCargoTarball.override {
cargo = writeShellScriptBin "cargo" ''
export CARGO_HTTP_CAINFO="${cacert}/etc/ssl/certs/ca-bundle.crt"
export SSL_CERT_FILE="${cacert}/etc/ssl/certs/ca-bundle.crt"
${cargo}/bin/.cargo-wrapped "$@"
'';
};
}; |
Should be resolved by #210366 |
Describe the bug
Nix is able to fetch source dependencies from github and other URLs but building a rust package fails when rust is trying to fetch the cargo dependencies.
CURL_CA_BUNDLE
GIT_SSL_CAINFO
andSSL_CERT_FILE
contain paths to the certificate chain of the intercepting proxy.To Reproduce
Steps to reproduce the behavior:
CURL_CA_BUNDLE
,GIT_SSL_CAINFO
andSSL_CERT_FILE
to/etc/ssl/certs/ca-bundle.crt
security.pki.certificates = [ (lib.readFile ./intercepting-proxy.pem ];
Expected behavior
The package is built from source and can be used in configuration
Screenshots
Additional context
Add any other context about the problem here.
Notify maintainers
@Ericson2314 @bhipple
Metadata
"x86_64-linux"
Linux 5.4.35, NixOS, 20.09pre-git (Nightingale)
no
yes
nix-env (Nix) 2.3.4
/nix/var/nix/profiles/per-user/root/channels/nixos
Maintainer information:
The text was updated successfully, but these errors were encountered: