Repository navigation
feat(tlsio,repo): CA-path validation for sc+https:// (ADR-0054) - #202
Conversation
SC_HTTPS_CA_FILE=<pem> or SC_HTTPS_CA=system switches a client from SPKI pinning to validating the chain, validity window and name against a CA, so a CA-issued (ACME/private CA) server needs no first-connect trust and survives certificate rotation. It replaces pinning for the connection (the pin file is neither read nor written), completes the handshake before any application byte, and fails closed on an unusable bundle, an unrecognized value, both knobs, or a pre-pin combined with CA trust. Revocation is not checked. Pin mode is the unchanged default. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
⛔ Files ignored due to path filters: 1
📒 Files selected for processing: 12
✨ Finishing Touches
Comment |
…to pinning) Sol review: a CA variable that is present but empty (an unset shell variable) or not valid UTF-8 read as absent and silently restored TOFU, which would send the bearer token to an unverified host; both are now errors, as is a non-UTF-8 SC_HTTPS_FINGERPRINT. A PEM bundle with a block that is not a certificate is refused instead of quietly shrunk; partial system-store load errors are reported as warnings (the loaded roots still validate); and CA mode no longer needs HOME/XDG/SC_HTTPS_KNOWN_HOSTS to resolve an unused pin file. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Independent Codex Sol (gpt-6.1-sol, read-only) security review of the diff found five issues, all fixed in the follow-up commit with tests: (1, high) an empty |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 149dcb202a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…e-pin Codex: from_env rejected the combination but the public env-free seam let CA validation silently win over a requested fingerprint. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
All three Codex findings are handled on the current head: CA selection now resolves before the pin path is required ( |
Problem
sc+https://trust is pin-only (ADR-0042): the client pins SHA-256(SPKI) and ignores names and validity. That fits a self-minted identity and fits a CA-issued certificate badly: an ACME/certbot certificate rotates every few weeks, usually with a new key, so the pin breaks on every renewal, and the first connection is unverified even though a CA vouches for the server. ADR-0042 named CA-path validation as an additive follow-on; the server already serves an operator PEM pair (--tls-cert/--tls-key).Change
A client opts in with
SC_HTTPS_CA_FILE=<pem>(a CA bundle) orSC_HTTPS_CA=system(platform roots viarustls-native-certs, already in the lockfile through the AWS SDK).scl_tlsio::client_connect_cavalidates like a browser: chain to a trusted anchor, validity window, and that the certificate covers the name or IP dialled; handshake signatures as always, and the handshake completes before any application byte (the bearer token) is written.SC_HTTPS_STRICThas no meaning.SC_HTTPS_CAvalue, both knobs at once, orSC_HTTPS_FINGERPRINTtogether with CA trust is an error, never a fall back to accept-new.scl_tlsiostays the only crate linking rustls; the repo layer carries the choice asCaSourceinTlsClientPolicy.ADR-0054 records it; THREAT-MODEL, ROADMAP, CLAUDE.md and the CLI reference are updated.
Verification
scl_tlsioend to end with a throwaway CA and the leaf it issued: connects by DNS name and by IP and moves data; a certificate from another CA is rejected; a certificate issued for a different name is rejected despite a valid chain; an empty or missing bundle is an error.scl_repo: the env resolver fails closed on every bad combination; a CA policy against a real TLS server refuses it, never creates the pin file and fails closed on a missing or empty bundle.cargo fmt,cargo clippy --workspace --all-targets -D warnings,cargo test --workspacepass.🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
sc+https://connections. Configure a PEM bundle withSC_HTTPS_CA_FILEor use the system trust store withSC_HTTPS_CA=system.Documentation