Skip to content

feat: client hello + certificate request builders - #437

Merged
kacy merged 1 commit into
mainfrom
feat/mtls-handshake-builders
Jun 9, 2026
Merged

feat: client hello + certificate request builders#437
kacy merged 1 commit into
mainfrom
feat/mtls-handshake-builders

Conversation

@kacy

@kacy kacy commented Jun 9, 2026

Copy link
Copy Markdown
Owner

summary

third PR-4 chunk (after #435, #436). adds the three missing handshake
builders the client driver needs:

  • buildClientHello — emits the narrow profile (AES-256-GCM, X25519,
    TLS 1.3, ECDSA P-256 + SHA-256, ALPN h2 + http/1.1, optional SNI).
    round-trips through the existing parseClientHelloFields so wire
    compatibility with the server is proven by an inline test.
  • buildCertificateRequest — context-empty, single sig scheme
    (0x0403). minimal because we control both ends.
  • buildCertificateVerify now takes a CertVerifySide enum to pick the
    per-side context string. silent-bug class: handshake completes if you
    use the wrong one, but no other TLS implementation accepts it. tested
    with both .server and .client producing different signatures over
    the same transcript.

server caller (session_runtime.zig) and existing tests updated to pass
.server — no behavior change.

not in this PR

  • client session driver (next chunk, biggest piece)
  • server-side MtlsOpts (CertificateRequest emit + client-cert verify)
  • end-to-end socketpair mTLS round-trip + negative tests

still no auto-merge per the PR-4 instruction.

three pieces for the client side of the handshake:
- buildClientHello emits AES-256-GCM / X25519 / TLS 1.3 / ECDSA-
  P256+SHA256 / ALPN(h2, http/1.1) with an optional SNI. round-trips
  through the existing parseClientHelloFields, proving wire compat.
- buildCertificateRequest emits a context-empty request advertising
  only ecdsa_secp256r1_sha256.
- buildCertificateVerify now takes a CertVerifySide enum and picks the
  matching context string. the server caller passes .server (no
  behavior change); the client will pass .client. an inline test
  proves the two sides produce different signatures over the same
  transcript.

these are the wire-format pieces — the client driver that uses them
arrives in the next chunk.
@kacy
kacy merged commit bb9458e into main Jun 9, 2026
10 checks passed
@kacy
kacy deleted the feat/mtls-handshake-builders branch June 9, 2026 17:30
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.

1 participant