Add --system-truststore option for OS trust store TLS verification#11
Merged
Conversation
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.
Summary
Adds a global
--system-truststoreoption (envENTROPY_DATA_SYSTEM_TRUSTSTORE) that verifies TLS using the operating system's certificate trust store (macOS Keychain, Windows certificate store, Linux system CAs) instead of the bundledcertifiCA list. This lets the CLI work behind a corporate TLS-inspecting proxy or with an internal CA whose root is installed in the OS trust store but not in the bundled list — the typicalCERTIFICATE_VERIFY_FAILED: unable to get local issuer certificatesituation.When the flag (or env var) is set, the app callback calls
truststore.inject_into_ssl()before any request, so it applies to every command that makes HTTPS calls. Certificate verification stays on; only the trust source changes.This ports the feature just added to
datacontract-cli(datacontract/datacontract-cli#1341), matching this repo'sENTROPY_DATA_env-var prefix.How it works
truststore>=0.10,<1.0dependency (uv.lockupdated).inject_system_truststore()helper; missing-package case exits with a clear message.[Unreleased]; version bump left for the separate release commit.Testing
uv run pytest(236 passed) anduv run ruff check .. Addedtests/test_cli.pycovering: the flag appears in--help, the flag injects, the env var injects, and no injection by default.