-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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
Provide more assistance for users to find SSL certificates (the "unable to get local issuer certificate" problem) #3382
Comments
Is it viable to make cacert a dependency of curl? @edolstra |
Why not just make cacert package default for curl and git? User can still
|
Even with the cacert package, you still need to point curl + git to the right place, I believe. |
Maybe if a .curlrc file was provided pointing to the cacert's location. |
For the failure case see for example https://gist.github.com/kevinburke/4d85873466903ba2e4c0 |
Yes, because CURL_CA_BUNDLE is not set, but if you set this in curl
|
@offlinehacker that's what I said, make curl depend on cacert. Did you want to say something else? |
Same thing
|
+1 |
By far the easiest solution is to make OpenSSL (not curl) depend on cacert. However, that means that every change to cacert triggers a big rebuild. |
Well in that case it might be better to resolve per package. On Mon, Jul 28, 2014 at 6:25 PM, Eelco Dolstra [email protected]
-----BEGIN PGP PUBLIC KEY BLOCK----- mQENBFEY1PEBCADPOfERF2wo4qeoq9L1m2z4pKfWqNd4B6BsoFUWPNd7BXmY+9JG |
On second thought, there is a big security argument against making anything depend statically on cacert: it makes it impossible to remove a CA centrally. So in a DigiNotar situation, you have to check that no package in the store still has the revoked CA. |
Maybe the Nix installer should just run |
But if SSL_CERT_FILE is preset, it can be still overriden, and provides On Mon, Jul 28, 2014 at 7:16 PM, Eelco Dolstra [email protected]
-----BEGIN PGP PUBLIC KEY BLOCK----- mQENBFEY1PEBCADPOfERF2wo4qeoq9L1m2z4pKfWqNd4B6BsoFUWPNd7BXmY+9JG |
EDIT: More general proposal based on @edolstra one. nix-env activation scripts as At that point, curl would just have propagatedUserEnvPkgs = [ cacert ]; . That might solve also other problems like browser plugins that can be installed without creating a wrapper derivation for each change, or gdkpixbuf/immodules cache, or icons cache, or xmonad with contributions, or... That's not the functional way, however. But for non-ABI/API stuff, like cacert or other stuff might work. We shall not abuse it. |
Right now for example nix's curl and wget don't read the Darwin keychain and I'm forced to provide my own SSL_CERT_FILE (aka install nss-cacert) if I want to access any https website. If I do, I don't benefit from the system-wide certs that I installed to access my company's internal services. I believe a better solution would be to define a system-wide CA store for NixOS and configure OpenSSL to use the host's CA store by default (also on other systems). In NixOS's configuration.nix you would also have a ssl_ca list option to manage the list of certs available in the store. Eg: |
We do have that already, at least on NixOS. BTW, I had created an issue for related stuff #8247. |
I've been using nixos for ~6 months and just today encountered this problem with git for the first time. Any idea what changed? |
@chris-martin me too. Installing |
Added to the 16.03 milestone because we're going to get endless reports if this isn't fixed |
Yup, same here. ~6 months, then a |
I'm finding that anything I run in |
My hacky fix was to put |
Ran into this on OSX (10.14.6) as well, the fix was an adjustment of @mitchty's #3382 (comment)
|
Nice to stumble upon it 6 years after the initial discovery. Still lurking and still causing trouble. For me it was a per project nix-shell and direnv |
Things have improved since, what's really had about this issue is that it needs to be reproducible. Or at the very least, list exact steps and details that led to it. |
I don't know if it is related, but... I have a shell.nix like this
and I'm trying to build a cargo project with SDL2 and the "bundled" feature. That is, cargo.toml looks like
when I try to build, I got
Is it related in some ways? Is there a way to get around this issue? (Using NixOs but quite noob in this regard) |
probably look at pkgs/build-support/docker/default.nix that exports |
I marked this as stale due to inactivity. → More info |
I am doing a PR today or in the next days which will fix most issues mentioned in this issue and you only need to set the following envs for the nix-daemon:
|
See #138011 |
Please note that curl reporting |
I just ran into this too. Setting |
After update curl to 7.82 http3 connection not working:
It worked for me with this patch: diff --git a/pkgs/tools/networking/curl/default.nix b/pkgs/tools/networking/curl/default.nix
index c032ba61c12..700111e1eaf 100644
--- a/pkgs/tools/networking/curl/default.nix
+++ b/pkgs/tools/networking/curl/default.nix
@@ -107,10 +107,8 @@ stdenv.mkDerivation rec {
configureFlags = [
# Build without manual
"--disable-manual"
- # Disable default CA bundle, use NIX_SSL_CERT_FILE or fallback
- # to nss-cacert from the default profile.
- "--without-ca-bundle"
- "--without-ca-path"
+ "--with-ca-bundle=/etc/ssl/certs/ca-certificates.crt"
+ "--with-ca-path=/etc/ssl/certs"
(lib.enableFeature c-aresSupport "ares")
(lib.enableFeature ldapSupport "ldap")
(lib.enableFeature ldapSupport "ldaps") Can this fix be added to NixOS? |
@vcunat was this closed erroneously? Your commit looks like it's just darwin? |
I just did the staging workflow, merging this to master indirectly. I haven't reviewed this particular change. |
Yes which is intentional. The compile flags are workarounds which are only required for darwin and break things on linux. |
Then this should be reopened. I can't reopen it. |
Can you explain what is still lacking that makes you think this isn't closed? |
Maybe I missed something but I thought this was a problem on all platforms and the above commit only fixed it on darwin? |
The above commit (https://github.com/nixpkgs/nixpkgs/commit/a3125da673250ce9d5ca2e2ce3f152db96cc303c) affected all platforms but darwin. |
Doh, OK 👍 |
This caused me a big headache yesterday. A solution (for git) is to install cacert and then run GIT_SSL_CAINFO=$HOME/.nix-profile/etc/ca-bundle.crt, but when running outside nixos that environment variable isn't set and there's no warning/indication that you'd need to set anything.
Basically this means curl/git are broken out of the box.
A nice thing would be to print "Curl has installed but no SSL certificates are currently available, which means all SSL operations will fail. To add SSL certificates, install the cacert package, then set CURL_CA_BUNDLE=$HOME/.nix-profile/etc/ca-bundle.crt in your environment", in bright red, when curl is installed, and a similar message for git.
It would also be nice if the packages just shipped with a certificate list.
The text was updated successfully, but these errors were encountered: