feat: client hello + certificate request builders - #437
Merged
Conversation
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.
This was referenced Jun 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
parseClientHelloFieldsso wirecompatibility with the server is proven by an inline test.
buildCertificateRequest— context-empty, single sig scheme(
0x0403). minimal because we control both ends.buildCertificateVerifynow takes aCertVerifySideenum to pick theper-side context string. silent-bug class: handshake completes if you
use the wrong one, but no other TLS implementation accepts it. tested
with both
.serverand.clientproducing different signatures overthe same transcript.
server caller (
session_runtime.zig) and existing tests updated to pass.server— no behavior change.not in this PR
MtlsOpts(CertificateRequest emit + client-cert verify)still no auto-merge per the PR-4 instruction.