feat(tls): client certificates in std/tls (mutual TLS) #490
Loading…
Reference in a new issue
No description provided.
Delete branch "loop/117-tls-client-certificates"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #117
A
std/tlsclient can present a certificate and key (ClientIdentity,TlsSettings.identity), and a server can require and verify one (clientRootsofTlsStream.accept). FIRST-PARTY.md gap 19.Two Conventional Commits:
feat(tls): present a client certificate and require one on a server: runtime (torb_tls_present,torb_tls_require_client), natives rowstlsPresent/tlsRequire, regenerated header and machine natives, NATIVES.md, C tests.feat(tls): client certificates in std/tls: std API, conformance testtests/conformance/tls-client-certificate.trb, NETWORK.md section 5,docs/standard-library/tls.md,skills/, gap 19 marked done.Seed impact: none (nothing in
compiler/srcimportsstd/tls; the seed is untouched).Deviations and open points:
clientAuth, leaf of an unrelated root) are inruntime/tests/tls_certificates.h; the conformance test copies the PEMs from there instead of signing with the root oftls-loopback.trb.std/tlshas no switch for the protocol version. The 1.3 refusals show the late-alert path; a failingconnect,sendorreceiveis treated alike, so a 1.2 peer prints the same lines.tests/conformance/tls-client-certificate.expectedwas written from reasoning and.allocationscopies theunbudgeted:text oftls-alpn; both are to be fixed from the first CI run. The kind asserts for refused handshakes inruntime/tests/tls_test.caccept 12..14 and get tightened once CI shows the mapping.docs checkwith the previous nightly reports the new natives as unknown (expected until this branch's own toolchain builds); CI is the gate.CI red on
9c353e8:ci / tier A (linux-x64)(andgates) - shard 4 of 4,compiler/tests/natives-audit.test.trb:354:the audit table of the natives > the counts of the record are the rows of the tablesfails onwritten.get("keep") == counted.get("keep"). The PR adds twokeeprows (tlsPresent,tlsRequire) to the audit table indocs/design/NATIVES.md, so the writtenkeepcount of the record is most likely not bumped by 2. Everything else in tier A passed (3172 passed, 1 failed). No review yet; the next CI run brings me back.Checklist (head
8a202d2, CI green on this head):tls-client-certificate(mutual, no identity, rogue root, two roots, not required, unreadable/partly unreadable/empty roots, key of another certificate); tier A/B, bootstrap and the earlier natives-audit count are green.torb_tls_presentrejects server sessions, a second identity and post-handshake calls, and takes its own share of the identity;torb_tls_require_clientis all-or-nothing on the roots (partial parse drops the list, never verifies against part of it), usesVERIFY_REQUIREDagainst exactly the given roots, not the platform store. Failure paths close the session.Non-blocking:
runtime/tests/tls_test.ckind asserts for refused handshakes accept 12..14; tighten to the observed mapping now that CI shows it.tls-client-certificate.allocationsisunbudgeted:andtls-loopback.allocationswent 505 -> 517; a short note on why the loopback budget moves would help the next reader.