Skip to content

Research: TLS & token-confidentiality options for sc+http #25

Closed

Description

@tonibergholm

Part of #24

Question

What are the viable options for keeping sc+http bearer tokens and repository traffic confidential, and what does each cost? Survey at minimum: in-binary TLS (rustls — dep weight, cert plumbing, how comparable Rust tools ship it), documented reverse-proxy-only (nginx/caddy patterns, what the docs must say), and non-bearer auth that avoids plaintext token theft even without TLS (challenge-response/HMAC over the existing wire opening, token binding). Note interactions with the existing opening codec (crates/repo/src/http_transport.rs) and PROTOCOL_VERSION. Deliverable: a markdown summary linked from this ticket, framing trade-offs for the decision ticket.

Activity

  1. self-assigned this
    on Jul 10, 2026
  2. tonibergholm commented on Jul 10, 2026

    @tonibergholm
    MemberAuthor

    Resolution

    Research complete. Asset: docs/research/tls-options-sc-http.md (lands on main via PR #34, awaiting merge).

    Key findings:

    • One seam, no wire break. Every option plugs into the same two functions where TcpStream appears (WireClient<R, W> / serve_with_policy(impl Read, impl Write)); PROTOCOL_VERSION stays 3 in all options, and none breaks existing sc+http:// remotes.
    • In-binary rustls is cheaper than assumed: measured 14 new crates (ring provider) / 18 + cmake (default aws-lc-rs); blocking rustls::Stream, no async runtime; MSRV a non-issue; self-signed + TOFU pinning needs a ~4-method hand-written verifier and zero extra crates for PEM. sc+https:// is already reserved by ADR-0036. ACME rejected (async stack).
    • Reverse-proxy TCP-mode termination confirmed for nginx stream, HAProxy mode tcp, stunnel; caddy-l4 is officially unofficial. The current THREAT-MODEL guidance is incomplete: a server-side proxy alone encrypts nothing end-to-end — the sc+http:// client has no TLS leg, so the client must also tunnel (client-mode stunnel / ssh -L), which no current doc says.
    • Challenge-response (dep-free) closes passive token theft only, and turns the stored BLAKE3 token hash into a pass-the-hash credential (server must key by the stored hash) — must be recorded in the threat model if chosen. Ed25519 nonce-signing (reusing scl-id v2) is the variant without the pass-the-hash cost.
    • Noise via snow: smallest marginal footprint (9 crates, large overlap with crates/crypto), WireGuard/Radicle precedent — but snow is explicitly unaudited, and its default std feature compiles ring anyway (verified via cargo tree).
    • Prior art cuts both ways: Vaultwarden/Garage punt server TLS to proxies, but sc's client must reach servers its operator doesn't control — the case where in-binary TLS is genuinely load-bearing.

    Framing for the decision ticket (#26): four candidate resolutions — R1 docs-only (fix the two-legged proxy story, promote ssh://), R2 challenge-response now + R1 docs, R3 in-binary rustls sc+https:// (self-signed+TOFU, PEM optional), R4 Noise. R2+R1 now → R3 later composes cleanly (TLS wraps below the opening); the one trap is letting R2 read as having closed the traffic-confidentiality question.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

wayfinder:researchWayfinder ticket: AFK research → markdown summary

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions