Skip to content

feat(repo,cli): close the four P32 TLS follow-ons - #208

Merged
tonibergholm-codento merged 7 commits into
mainfrom
p32-followons
Oct 19, 2026
Merged

tonibergholm-codento merged 7 commits into
mainfrom
p32-followons

Conversation

@tonibergholm

@tonibergholm tonibergholm commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Closes the P32 follow-ons item in ROADMAP.md.

  1. Mint only inside a repo. sc serve fingerprint and --tls auto-mint refuse a root with no .sc/, naming sc init, instead of minting a stray identity.
  2. Downgrade warning. A set SC_HTTPS_STRICT/FINGERPRINT/KNOWN_HOSTS/CA_FILE/CA with a plaintext sc+http:// URL prints a stderr warning (the knob does nothing there).
  3. Client bound. The connect, TLS handshake, opening, status line and wire handshake share a 30 s bound, so a peer that accepts and goes silent fails the connect (ConnectionLost) instead of hanging it; the bound is lifted after the handshake so long transfers are unaffected. Covered for plaintext and TLS, plus a test that an idle connection outlives the bound.
  4. sc remote add parse-validates sc+http(s):// URLs at add time, like ssh:// and the bucket schemes.

The client bound is not configurable. ADR-0042 and ROADMAP.md updated. cargo clippy --workspace --all-targets -- -D warnings clean; cargo test --workspace 993 passed, 0 failed.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • TLS fingerprint generation and automatic certificate setup now require an existing repository, including when run from a subdirectory.
    • sc remote add now rejects malformed sc+http:// and sc+https:// URLs before saving them.
    • Network connection and handshake waits now have fixed time limits, with timeout failures reported as connection errors.
    • Using HTTPS-only settings with a plaintext sc+http:// URL now triggers a warning.

- sc serve fingerprint and --tls auto-mint refuse a root with no .sc/.
- Warn when an SC_HTTPS_* knob is set but the URL is plaintext sc+http://.
- Bound the sc+http(s) client's connect, TLS handshake, opening and wire
  handshake (30 s) so a silent peer fails the connect; lift it afterwards.
- sc remote add parse-validates sc+http(s):// URLs at add time.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-19T17:04:34.716333Z 681d5ea New commits
🔒 Security Review ✅ Completed 2026-10-19T17:05:01.688526Z 681d5ea New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ab71c668-b0cb-4ea8-b4c6-a86a249ff87e
📥 Commits

Reviewing files that changed from the base of the PR and between 512536a and 681d5ea.

📒 Files selected for processing: 10
  • .claude/skills/sc-cli-reference/SKILL.md
  • ROADMAP.md
  • crates/cli/src/main.rs
  • crates/cli/tests/remote_add_validation.rs
  • crates/repo/src/http_transport.rs
  • crates/repo/src/stdio_transport.rs
  • crates/repo/src/wire.rs
  • crates/tlsio/src/stream.rs
  • crates/tlsio/src/trust.rs
  • docs/adr/0042-in-binary-tls-sc-https.md
+-----------------------------------------------------------------+
| Granted, I'm not human, but I still know when your code is bad. |
+-----------------------------------------------------------------+
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 54d053bdee

ℹ️ 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".

Comment thread crates/repo/src/http_transport.rs Resolved
Comment thread crates/repo/src/http_transport.rs Resolved
Comment thread crates/repo/src/http_transport.rs Resolved
Comment thread crates/repo/src/http_transport.rs Resolved
Comment thread crates/cli/src/main.rs Resolved
tonibergholm and others added 3 commits October 19, 2026 19:42
… discover the repo

Codex: a timeout in the TLS handshake or wire handshake now surfaces as
ConnectionLost like the opening read; the connect shares one deadline across
resolved addresses; an empty CA knob counts as set for the downgrade warning;
sc serve fingerprint finds the repo from a subdirectory; and the reserved
sc+http:/sc+https: prefix, not just the exact form, is parse-validated at add.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Reviewer: the lift test passed with the lift removed, so it now inspects the
live socket options (and fails without the lift). A bucket-backed server opens
its bucket before answering HELLO, so the wire handshake gets 300 s while the
connect, TLS and opening keep 30 s. Docs say these are inactivity bounds.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 987f6bab8f

ℹ️ 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".

Comment thread crates/repo/src/http_transport.rs Resolved
Comment thread crates/repo/src/http_transport.rs Resolved
…knobs

Codex: to_socket_addrs ran before the deadline could apply, so a stalled
resolver defeated the connect bound; and var() hid a non-UTF-8 SC_HTTPS_* value
from the downgrade warning. Resolve on a helper thread under the deadline and
read the knobs with var_os.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1b1fe9a1b7

ℹ️ 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".

Comment thread crates/repo/src/http_transport.rs Resolved
Codex: write_client_opening turned every write failure into InvalidArgument, so
a peer that never reads (opening larger than the socket buffers) hit the new
write bound but got the wrong typed error.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ab830f18cd

ℹ️ 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".

Comment thread crates/repo/src/http_transport.rs Resolved
Codex: with one shared deadline, a first address that silently drops packets
could use all of it and starve a reachable later address.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

@tonibergholm-codento tonibergholm-codento left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Required checks green on 681d5ea; reviewer and Codex findings fixed and resolved.

@tonibergholm-codento
tonibergholm-codento merged commit fddecf3 into main Oct 19, 2026
7 of 8 checks passed
@tonibergholm
tonibergholm deleted the p32-followons branch October 19, 2026 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants