Repository navigation
awscli2: make the vendored botocore prefer the system CA bundle - #580303
ethancedwards8 wants to merge 1 commit into
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. (cherry picked from commit 23a59d0)
There was a problem hiding this comment.
This report is automatically generated by the PR / Check / cherry-pick CI workflow.
Some of the commits in this PR require the author's and reviewer's attention.
Sometimes it is not possible to cherry-pick exactly the same patch.
This most frequently happens when resolving merge conflicts.
The range-diff will help to review the resolution of conflicts.
If you need to merge this PR despite the warnings, please dismiss this review shortly before merging.
Warning
Difference between 94e001b and original 23a59d0 may warrant inspection.
Show diff
@@ Commit message
Part of #576541.
- Assisted-by: Claude Code (claude-opus-5)
+ (cherry picked from commit 23a59d049dd98b966f791d83e3b8fe1e0ac56352)
## pkgs/by-name/aw/awscli2/package.nix ##
+@@
+ awscli2,
+ addBinToPathHook,
+ writableTmpDirAsHomeHook,
++ cacert,
+ }:
+
+ let
@@ pkgs/by-name/aw/awscli2/package.nix: py.pkgs.buildPythonApplication rec {
+ # with a configure script, but we don't as we provide all of the packages
+ # through PYTHONPATH
sed -i '/pip>=/d' requirements/bootstrap.txt
-
- ln -sf ${cacert}/etc/ssl/certs/ca-no-trust-rules-bundle.crt awscli/botocore/cacert.pem
++
++ ln -sf ${cacert}/etc/ssl/certs/ca-no-trust-rules-bundle.crt awscli/botocore/cacert.pem
+ cat ${./system-ca-bundle.py} >> awscli/botocore/httpsession.py
'';
Hint: The full diffs are also available in the runner logs with slightly better highlighting.
❌
|
|
Done in #584152 |
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 #576541.
(cherry picked from commit 23a59d0)
Things done
./result/bin/.nixpkgs-reviewon this PR. See nixpkgs-review usage.passthru.tests.