go: use NIX_SSL_CERT_FILE for crypto/x509#24058
Conversation
|
Is this also relevant for nixos (regarding backport)? |
|
I would say yes. A single user install only sets |
|
In that case I would rather have this patch, if not necessary (on linux). |
|
@zimbatm There's no file with the cert bundle on darwin so it's not possible to use the host's CA like on other systems. I don't know if this is an issue with cgo or the |
|
This seems to be related to our issue: golang/go#17972 . Basically Go's interface to the native Mac TLS/CA library is not very stable.
|
| ]; | ||
|
|
||
| SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt"; | ||
| NIX_SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt"; |
There was a problem hiding this comment.
Why does this need to be set in the build env?
There was a problem hiding this comment.
Yeah, it's unclear to me why Go would need a certificate bundle at build time. Is it going to download something via https?
There was a problem hiding this comment.
I hope not! Perhaps it does some sort of sanity check during tests? Seems weird though...
|
So it seems like we should open a separate issue about the |
|
I ran into this issue today. If you have an older Nix installation (like I did) which defines export NIX_SSL_CERT_FILE="${SSL_CERT_FILE}"... and then the segmentation fault goes away |
Motivation for this change
Fixes issues with crypto/x509 since
SSL_CERT_FILEwas renamed toNIX_SSL_CERT_FILE, eg./cc @zimbatm
Things done
(nix.useSandbox on NixOS,
or option
build-use-sandboxinnix.confon non-NixOS)
nix-shell -p nox --run "nox-review wip"./result/bin/)