SSL Handling - #111
Merged
Merged
SSL Handling#111
Conversation
Contributor
Reviewer's GuideThe PR avoids SSL context races caused by truststore injection by lazily importing the S3 uploader and synchronizing botocore’s cached SSLContext with the active stdlib context at module load and uploader construction, with tests covering import behavior and synchronization paths. Sequence diagram for synchronized S3 SSL setupsequenceDiagram
participant Pytest
participant S3UploaderModule
participant Sync as sync_botocore_ssl_context
participant Truststore
participant Botocore
participant S3Uploader
Truststore->>ssl: inject_into_ssl()
Pytest->>S3UploaderModule: import s3_uploader
S3UploaderModule->>Sync: sync_botocore_ssl_context()
Sync->>Botocore: read httpsession.SSLContext
Sync->>ssl: read SSLContext
alt contexts differ
Sync->>Botocore: assign httpsession.SSLContext = ssl.SSLContext
end
Pytest->>S3Uploader: __init__()
S3Uploader->>Sync: sync_botocore_ssl_context()
S3Uploader->>Botocore: create S3 client
Botocore-->>S3Uploader: client uses active SSLContext
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #111 +/- ##
==========================================
+ Coverage 68.15% 69.54% +1.38%
==========================================
Files 7 7
Lines 829 834 +5
Branches 140 141 +1
==========================================
+ Hits 565 580 +15
+ Misses 235 225 -10
Partials 29 29
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
mshriver
force-pushed
the
ssl-handling
branch
2 times, most recently
from
September 7, 2026 14:49
fa2fe28 to
b09dde9
Compare
- Defer boto3/botocore imports until S3 upload mode is active to keep pytest plugin initialization lean. - Add `sync_botocore_ssl_context()` to align `botocore.httpsession.SSLContext` with active `ssl.SSLContext`, preventing Python 3.12+ `RecursionError` when `truststore` is injected. - Update mypy overrides and pre-commit configurations for boto dependencies. - Add unit tests covering lazy import behavior, SSL context synchronization, and urllib3 context creation. truststore handling Co-authored-by: Claude <noreply@anthropic.com>
mshriver
force-pushed
the
ssl-handling
branch
from
September 7, 2026 17:36
b09dde9 to
e9f406e
Compare
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.
avoid race conditions for ssl context with boto and other libraries that may call
truststore.inject_into_sslSummary by Sourcery
Ensure S3 uploads remain compatible with dynamically injected SSL trust stores while tightening type checking, diagnostics, and regression coverage.
New Features:
Bug Fixes:
Enhancements:
Build:
Tests: