Repository navigation
awscli2: make the vendored botocore prefer the system CA bundle - #576582
Merged
Merged
Conversation
awscli2 uses its own copy of botocore (awscli/botocore), not python3Packages.botocore. It copies the cacert bundle into awscli/botocore/cacert.pem at build time. It ignores NIX_SSL_CERT_FILE, SSL_CERT_FILE and the system store at run time. Override where() in awscli/botocore/httpsession.py so that get_cert_path() returns NIX_SSL_CERT_FILE, SSL_CERT_FILE, /etc/ssl/certs/ca-certificates.crt or /etc/ssl/cert.pem when one exists. The previous behaviour stays as the fallback. AWS_CA_BUNDLE and the ca_bundle setting still take precedence. The S3 CRT transfer client still uses DEFAULT_CA_BUNDLE (the cacert copy), because awscrt cannot read the "TRUSTED CERTIFICATE" blocks in ca-bundle.crt. Part of NixOS#576541. Assisted-by: Claude Code (claude-opus-5)
66 of 95 tasks
devusb
approved these changes
Oct 21, 2026
Contributor
|
@NixOS/nixpkgs-merge-bot merge |
Contributor
|
@devusb wants to merge this PR. Requirements to merge this PR with
|
Contributor
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin release-26.05
git worktree add -d .worktree/backport-576582-to-release-26.05 origin/release-26.05
cd .worktree/backport-576582-to-release-26.05
git switch --create backport-576582-to-release-26.05
git cherry-pick -x 23a59d049dd98b966f791d83e3b8fe1e0ac56352 |
5 of 13 tasks
Member
|
backport #580303 |
This was referenced Nov 6, 2026
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.
awscli2 uses its own copy of botocore (awscli/botocore), not python3Packages.botocore. It copies the cacert bundle into awscli/botocore/cacert.pem at build time. It ignores NIX_SSL_CERT_FILE, SSL_CERT_FILE and the system store at run time.
Override where() in awscli/botocore/httpsession.py so that get_cert_path() returns NIX_SSL_CERT_FILE, SSL_CERT_FILE, /etc/ssl/certs/ca-certificates.crt or /etc/ssl/cert.pem when one exists. The previous behaviour stays as the fallback. AWS_CA_BUNDLE and the ca_bundle setting still take precedence.
The S3 CRT transfer client still uses DEFAULT_CA_BUNDLE (the cacert copy), because awscrt cannot read the "TRUSTED CERTIFICATE" blocks in ca-bundle.crt.
Tested on x86_64-linux with
aws sts get-caller-identity --region us-east-1and a boto3 script, using fake AKIA…EXAMPLE keys so the request reaches STS: with SSL_CERT_FILE (or NIX_SSL_CERT_FILE) holding one unrelated root, the old build still completes TLS and getsInvalidClientTokenId; the new build fails withCERTIFICATE_VERIFY_FAILED. With the system bundle, with no variable set (falls back to /etc/ssl), or withAWS_CA_BUNDLE, the new build getsInvalidClientTokenIdas expected. nixpkgs already links the vendored cacert.pem to cacert at build time; the problem was that botocore never consulted the runtime CA variables. The S3 CRT client still reads the build-time copy, because awscrt cannot parse TRUSTED CERTIFICATE blocks.Related to: #576485
Related to: #576541
Assisted-by: Claude Code (claude-opus-5)
Things done
./result/bin/.nixpkgs-reviewon this PR. See nixpkgs-review usage.passthru.tests.