code wiki / (root) / nx_tls13_client_h2run.nx

nx_tls13_client_h2run.nx

buildroot/runtime/nx_tls13_client_h2run.nx

7786 B174 linesdepth 18pulls 108 transitivereach 6 importersview sourcekind tooltopic tls13
docsdependenciesstructsconstsfunctions

about

nx_tls13_client_h2run.nx -- TUTOR-BOOTSTRAP SCAFFOLD (Claude, authored under the R4-H2 HTTP/2-transport-ladder workflow, capstone NBC-FETCH-001), NOT credited as team self-authoring. THE h2-NEGOTIATING TLS 1.3 client handshake orchestrator. It is the byte-for-byte twin of nx_tls13_client_session_run.nx (step 3c.6b) EXCEPT the ClientHello it emits advertises ALPN ["h2"] ONLY (via the new tls13_client_hello_emit2_h2only / tls13_ext_emit_alpn_h2_only). Consequence (RFC 7301 ยง3.2): the server either selects "h2" -- so a CONNECTED session here means the application-data channel IS HTTP/2, no encrypted-EE ALPN parse needed -- or it MUST abort the handshake with no_application_protocol. This is how a sovereign client makes "TLS ALPN selects h2" a yes/no the caller can branch on. FOUNDED ON (composes, does NOT reinvent -- anti-orphan law; each imported EXACTLY ONCE, the RC6 double-import landmine avoided): - nx_tls13_client_session.nx (the session struct + emit-CH internals + transcript update; it transitively imports nx_tls13_hello.nx where the new h2-only ClientHello emitter and ALPN-h2-only extension live) - the recv_sh / recv_hs / emit_finished / derive_app step organs and nx_tls13_read_record_from_fd -- the SAME set nx_tls13_client_session_run imports, so the handshake body is identical to the proven HTTP/1.1 run. This module deliberately does NOT import nx_tls13_client_session_run.nx (that would double-define _write_n etc.); helper / const names carry an _H2 suffix so a caller may import BOTH this and the http/1.1 run with no symbol clash. BACK-FILL: the team RE-AUTHORS this from the DATA spec (knowledge/specs/2026-06-13-http2-transport-ladder.md) via the emitter-of-emitters (X-AUT-006c/e/f); this hand scaffold is the sanctioned one-time bootstrap only (meter-integrity). license_tier: INDEPENDENT_REDERIVE genealogy_id: international-research-sources/ietf/rfc_8446 + rfc_7301 + rfc_9113 lineage_id: nishi_tls13_client_h2run_r4h2_capstone

dependencies 10 imports · 6 importers

nx_syscalls.nx nx_tls13.nx nx_tls13_record.nx nx_tls13_client_validate_certifica nx_tls13_client_session.nx nx_tls13_client_session_recv_sh.nx nx_tls13_client_session_recv_hs.nx nx_tls13_client_session_emit_finis nx_tls13_client_session_derive_app nx_tls13_read_record_from_fd.nx nx_tls13_client_h2run.nx _h2_fetch_google.nx _h2_fetch_rumble.nx _h2_probe_imgsearch.nx _h2_probe_imgsearch_ua.nx _h2_reach_probe.nx _h2_serve_loopback_gate.nx

imports: nx_syscalls.nxnx_tls13.nxnx_tls13_record.nxnx_tls13_client_validate_certificate.nxnx_tls13_client_session.nxnx_tls13_client_session_recv_sh.nxnx_tls13_client_session_recv_hs.nxnx_tls13_client_session_emit_finished.nxnx_tls13_client_session_derive_app.nxnx_tls13_read_record_from_fd.nx

imported by: _h2_fetch_google.nx_h2_fetch_rumble.nx_h2_probe_imgsearch.nx_h2_probe_imgsearch_ua.nx_h2_reach_probe.nx_h2_serve_loopback_gate.nx

structs

none

consts

45const NX_MAGIC_1024: i64 = 1024
47const NX_TLS13_H2RUN_OK: i64 = 1
48const NX_TLS13_H2RUN_EMIT_CH_FAIL: i64 = 2
49const NX_TLS13_H2RUN_WRITE_CH_FAIL: i64 = 3
50const NX_TLS13_H2RUN_READ_SH_FAIL: i64 = 4
51const NX_TLS13_H2RUN_RECV_SH_FAIL: i64 = 5
52const NX_TLS13_H2RUN_READ_HS_FAIL: i64 = 6
53const NX_TLS13_H2RUN_RECV_HS_FAIL: i64 = 7
54const NX_TLS13_H2RUN_EMIT_CF_FAIL: i64 = 8
55const NX_TLS13_H2RUN_WRITE_CF_FAIL: i64 = 9
56const NX_TLS13_H2RUN_DERIVE_APP_FAIL: i64 = 10
57const NX_TLS13_H2RUN_LOOP_BUDGET_EXCEEDED: i64 = 11
59const NX_TLS13_H2RUN_MAX_HS_RECORDS: i64 = 8
60const NX_TLS13_H2RUN_RECORD_BUF_BYTES: i64 = 16645

functions

63func _h2run_write_n(fd: i64, buf: *u8, n: i64) -> i64
73func _h2run_is_ccs(buf: *u8, n: i64) -> i64
83func nx_tls13_client_session_emit_ch_h2(
106func nx_tls13_client_session_run_h2(
172func main() -> i64