Skip to content

Decide: sc+https:// cert/key provisioning & TOFU pinning UX #35

Closed

Description

@tonibergholm

Part of #24

Question

#26 locked in-binary rustls sc+https:// with self-signed + TOFU pinning as the default and operator PEM optional. What is the concrete provisioning and pinning UX? At minimum: where the server keeps its minted cert/key (.sc/? regenerated when?); where the client stores pins (known_hosts-style user file — location, format) and what happens on first connect (silent accept-new, interactive fingerprint prompt, or strict pre-shared fingerprint) and on mismatch; a non-interactive override for scripting/CI (env var or flag, SC_HTTPS_FINGERPRINT-shaped); how operator PEM is passed to sc serve (--tls-cert/--tls-key); and whether sc serve token output/docs change to mention the fingerprint. Resolution feeds the same phase spec as #26.

Activity

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

    @tonibergholm
    MemberAuthor

    Resolution

    Concrete UX for #26's self-signed + TOFU decision — three locked pieces:

    1. First connect: accept-new (ssh StrictHostKeyChecking=accept-new semantics). Unknown host → pin silently, print the fingerprint loudly to stderr, proceed — safe for scripts and agent sessions, which are sc's primary consumers; an interactive prompt was rejected as mostly-theater assurance that hangs automation. Overrides: SC_HTTPS_FINGERPRINT=<spki-sha256> pre-pins for CI/high-assurance first connects; a strict mode refuses unknown hosts outright. A pin mismatch always hard-fails with a what-to-do-if-legitimate recovery hint — never an override prompt; fixing the pin file is a deliberate act.
    2. Pin storage & content: user-level ~/.config/sc/known_hosts, one line per host:port. The pin is the SHA-256 of the server's SPKI (public key), not the whole cert — survives same-key certificate renewal without re-TOFUing every client, and is independently verifiable with stock openssl tooling. Per-repo pins rejected (host identity isn't repo-scoped; clones would diverge silently). BLAKE3 rejected here (never enters the CAS; interop wins).
    3. Server lifecycle: explicit --tls per listener — sc serve --http <addr> --tls [--tls-cert <pem> --tls-key <pem>]; one port speaks exactly one protocol (no ClientHello sniffing), and plaintext sc+http:// survives for loopback/proxy use under the P29-tightened gate from Decide: transport confidentiality for sc+http (audit High #1) #26. Without operator PEM, the server auto-mints a self-signed cert (rcgen) on first TLS serve into .sc/serve-tls/ (cert.pem + key.pem, key 0600), persistent thereafter — under SPKI pinning the key IS the server's identity, so it must survive restarts; regenerated only if the files are missing. Long cert validity; the pinning verifier checks the key and deliberately ignores names/validity (pin-only trust in v1 — CA-path validation can join later for PEM deployments without breaking anything). Fingerprint discovery: the TLS serve startup banner prints the SPKI SHA-256, and a new sc serve fingerprint subcommand prints it on demand; sc serve token add output stays unchanged (transport identity and authorization are separate concerns — docs cross-reference).

    Fully consumes the ticket; remaining detail is phase-spec authorship for the assembly ticket. Parent decision: Decide: transport confidentiality for sc+http (audit High #1).

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

Metadata

Metadata

Assignees

Labels

wayfinder:grillingWayfinder ticket: HITL grilling/decision

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions