Skip to content
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

git, curl, openssl: Refactor $NIX_SSL_CERT_FILE handling #24203

Merged
merged 3 commits into from Mar 22, 2017

Conversation

layus
Copy link
Member

@layus layus commented Mar 22, 2017

Motivation for this change

The way NIX_SSL_CERT_FILE (and previously SSL_CERT_FILE) support leaks from openssl to git, passing by curl.

This changes shows that

  1. we can avoid patching git by fixing curl's patch
  2. we can avoid patching curl by making it rely on openssl's default CA
  3. we can enable the feature proposed in curl: Use CA bundle in nix default profile by default #23723 and dropped with refactor at point 2.

These points correspond to the three commits. The commits should be reviewed separately to make sense.

It is an improvement/rewrite of #24121

Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

/cc @shlevy @domenkozar @edolstra @vcunat

Improve patching of curl to use NIX_SSL_CERT_FILE as default CA
Remove patches from git, as git uses curl and passes its environment
variables to curl.
Having curl fall back to openssl's CA means that we need not patch curl
to respect NIX_SSL_CERT_FILE. It will work in all the cases.

This reverts commit fb4c43d "curl: Use CA bundle in nix default profile by default"
If we want to reintroduce that feature, this needs to go inside openssl
@mention-bot
Copy link

@layus, thanks for your PR! By analyzing the history of the files in this pull request, we identified @edef1c, @domenkozar and @edolstra to be potential reviewers.

@domenkozar
Copy link
Member

cc @shlevy

@edolstra edolstra merged commit f087598 into NixOS:staging Mar 22, 2017
@domenkozar
Copy link
Member

domenkozar commented Mar 22, 2017

This should also go to staging-17.03 if it works. @globin

@shlevy
Copy link
Member

shlevy commented Mar 22, 2017

Nice!

@layus
Copy link
Member Author

layus commented Mar 22, 2017

Thanks @shlevy :-).

Would you mind reviewing this on darwin, when hydra is ready ? Especially check that it does not introduce a regression for #23723. I have no darwin machine at hand.

PS: Is there a way to add regression tests for stuff like #23723 ?

@shlevy
Copy link
Member

shlevy commented Mar 22, 2017

I don't have a darwin box either, sadly. @copumpkin ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants