Repository navigation
python3Packages.botocore: use certifi for the CA bundle - #576583
Conversation
There was a problem hiding this comment.
Why would we not use what botocore does upstream, i.e., rely on certifi? See https://github.com/boto/botocore/blob/1.43.117/botocore/httpsession.py#L96.
Certifi was patched to honor NIX_SSL_CERT_FILE in #205127.
Feel free to add support for SSL_CERT_FILE.
|
FWIW this is the same workaround we applied to awscli: #576582 |
I'm not too familiar with botocore, but it looks like this is the fallback path when And I'm not entirely sure, because Python packaging in Nixpkgs is sometimes weird, but it looks like (without any other python environmental leakiness) So to properly handle this, I assume And relatedly, I think if relying on Unrelated to the specific fix... Whatever is done, this is not an appropriate way to patch this. It is terribly misguided and absolutely wild. If/whenever upstream decides to re-order or add classes to that file, the added @zimbatm, I know you know better than that regarding how to properly write Nixpkgs changes. Please critically self-review changes you send while thinking about the contributors and maintainers that will need to continue maintaining the packages. |
botocore takes its CA bundle from certifi.where() when it can import certifi, and falls back to its own cacert.pem otherwise. certifi was not a dependency, so the fallback was always used. The nixpkgs certifi reads NIX_SSL_CERT_FILE, and otherwise uses the cacert bundle. Assisted-by: Claude Code (claude-opus-5)
93822bc to
b17bf95
Compare
|
Thanks @dotlambda @samueldr-at-cyberus, the certifi approach is much better agreed. Updated the PR. I'll send a follow-up for awscli2 too. |
snue
left a comment
There was a problem hiding this comment.
I verified this works and does what it says. The certifi dependency is used. I couldn't nixpkgs-review the PR as the staging build is a bit much and also fails.
=== verdict ===
[PASS] with-env: certifi is importable (PR adds it as dependency)
[PASS] with-env: botocore CA bundle is certifi.where() == NIX_SSL_CERT_FILE
[PASS] with-env: TLS handshake SUCCEEDS against the probe-CA server
[PASS] no-env: certifi falls back to the system CA bundle
[PASS] no-env: handshake REJECTED (probe CA not in system bundle)
[PASS] no-certifi: botocore falls back to its own botocore/cacert.pem
[PASS] no-certifi: NIX_SSL_CERT_FILE ignored (handshake REJECTED)
all 7 checks passed: this botocore takes its CA bundle from certifi and therefore honours NIX_SSL_CERT_FILE
Thanks for the improved fix!
|
Successfully created backport PR for |
botocore takes its CA bundle from certifi.where() when it can import
certifi, and falls back to its own cacert.pem otherwise. certifi was not
a dependency, so the fallback was always used. The nixpkgs certifi reads
NIX_SSL_CERT_FILE, and otherwise uses the cacert bundle.
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.