Set CURL_CA_BUNDLE for curl CA certificate discovery in containers#233
Merged
Conversation
curl does NOT check SSL_CERT_FILE — it only checks CURL_CA_BUNDLE and its built-in CA bundle path. The nixpkgs-built curl has /no-cert-file.crt as its built-in path (a sentinel when cacert is absent at build time). The cacert setup-hook (from PR #232) sets SSL_CERT_FILE but not CURL_CA_BUNDLE, so curl still fails in containers with: curl: (77) error adding trust anchors from file: /no-cert-file.crt Set both CURL_CA_BUNDLE (for curl) and SSL_CERT_FILE (for OpenSSL-based tools) directly in mkShell to ensure CA certificates are found regardless of whether the cacert setup-hook has run.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CURL_CA_BUNDLEandSSL_CERT_FILEenv vars in all 4 shell environments (dynamic.nix,static.nix,cross-js.nix,cross-windows.nix)error adding trust anchors from file: /no-cert-file.crtin-envcontainerscacertto runtimeInputs but its setup-hook only setsSSL_CERT_FILE/NIX_SSL_CERT_FILE— curl does NOT check those, onlyCURL_CA_BUNDLEand its built-in pathContext
The nixpkgs-built curl has
/no-cert-file.crtas its compiled-in CA bundle path (a sentinel value when cacert is absent at build time). In containers, there is no system CA store at that path, and curl's code path only checksCURL_CA_BUNDLEenv var → built-in path. SettingCURL_CA_BUNDLEdirectly inmkShellensures curl finds the CA bundle.Test plan
cabal updateworks in-envcontainers (validates HTTPS with curl)