fix ssl: respect SSL_CERT_FILE and REQUESTS_CA_BUNDLE for CA bundle - #1033
Open
Tyagiquamar wants to merge 1 commit into
Open
Tyagiquamar wants to merge 1 commit into
Tyagiquamar wants to merge 1 commit into
Conversation
Tyagiquamar
requested review from
jbonzo,
justinpolygon,
kschoche,
lukeoleson,
mmoghaddam385 and
suever
as code owners
September 18, 2026 20:35
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.
What changed
massive/rest/base.py: new_default_ca_bundle()helper returnsSSL_CERT_FILEif set, elseREQUESTS_CA_BUNDLEif set, elsecertifi.where().BaseClientnow passes it asca_certsto theurllib3.PoolManagerinstead of hardcodedcertifi.where().massive/websocket/__init__.py: thewss://SSLContextloads verify locations from the same helper (removes the now-unused directcertifiimport).test_rest/test_ssl_ca_bundle.pywith 3 tests (precedence, fallback, certifi default) asserting both the helper and the poolconnection_pool_kw.Why
Fixes #998. Behind TLS-inspecting corporate proxies the SDK failed with
CERTIFICATE_VERIFY_FAILEDbecause it always used the bundled certifi CA, ignoring the standard env vars thatrequests,httpx, andurllib3conventions honor.Testing
Docker
python:3.11-bookworm:python -m unittest test_rest.test_ssl_ca_bundle— 3 passed; errors on base (helper absent, env ignored).python -m unittest discover -s test_rest— 42 passed.black --checkon all three touched files — clean (repo uses black per Makefile).