Navigation Menu

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

SSL certificate search failed to find user profile certificates. #2432

Merged
merged 2 commits into from Nov 15, 2018

Conversation

luke-clifton
Copy link
Contributor

No description provided.

@luke-clifton
Copy link
Contributor Author

@grahamc you seem best positioned to review this. There was a slight bug in the SSL CA search path.

@edolstra
Copy link
Member

Looks good to me, but maybe it would be even better to search $NIX_PROFILES? E.g.

for i in $NIX_PROFILES; do
  if [ -e $i/etc/ssl/certs/ca-bundle.crt ]; then
    export NIX_SSL_CERT_FILE=$i/etc/ssl/certs/ca-bundle.crt
    break
  fi
done

@luke-clifton
Copy link
Contributor Author

@edolstra I did originally consider that, but didn't want to introduce extra semantics on the order of the profiles because

  1. I was unsure if there was an existing semantics
  2. Without changing the order I thought it would be counter-intuitive (last one wins, unlike $PATH)
  3. I really didn't want to change the order because I didn't know what relied on it.

I just did a quick survey of nixpkgs, and there are numerous locations where the order is important, and oddly enough, in many cases, the first thing they do is reverse the list (see the listing at the end).

I've just pushed a commit that searches the path, preferring the last found profile (this agrees with existing use cases, but is counter to your snippet above, and, in my opinion, counter intuitive).

Obvious cases of reversing the NIX_PROFILE

nixpkgs/nixos/modules/programs/environment.nix:         export NIX_PROFILES="${concatStringsSep " " (reverseList cfg.profiles)}"
nixpkgs/pkgs/applications/editors/emacs/site-start.el:  (reverse (split-string (or (getenv "NIX_PROFILES") ""))))
nixpkgs/pkgs/applications/editors/vim/configurable.nix:      for p in reverse(split($NIX_PROFILES))
nixpkgs/pkgs/shells/fish/default.nix:      set -l __nix_profile_paths (echo $NIX_PROFILES | ${coreutils}/bin/tr ' ' '\n')[-1..1]

There are more cases that reference the variable (though, only ~30), I didn't audit them all for order dependencies.

@luke-clifton
Copy link
Contributor Author

@edolstra Just following up on this. Is there anything else you would like me to modify?

@luke-clifton
Copy link
Contributor Author

Ping?

@edolstra edolstra merged commit 32a0a22 into NixOS:master Nov 15, 2018
@edolstra
Copy link
Member

Thanks!

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

2 participants