nx_mtls_test_daemon.nx
buildroot/runtime/bin/nx_mtls_test_daemon.nx
about
nx_mtls_test_daemon.nx -- the mTLS INTEROP test daemon: proves run_ecdsa_mtls completes a real TLS 1.3
MUTUAL-auth handshake against a STANDARD client (openssl s_client / curl / a browser), and that run_ecdsa_mtls
VERIFIES the client cert that the standard client presents. This is the byte-level interop the loopback gate
cannot cover (the loopback proves the LOGIC against our own message construction; THIS proves the wire format
is correct against OpenSSL/Schannel/BoringSSL). It is the de-risk gate before the live doc-wall cutover.
NOT a live daemon -- a throwaway harness. Adapted from nx_tls13_ed25519_test_daemon (the proven server-auth
interop pattern) by swapping run_ed25519 -> run_ecdsa_mtls and logging the client-auth result.
FLOW: read ECDSA server cert+key (the demo P-256 cert) -> bind 127.0.0.1:7444 -> accept ONE conn ->
run_ecdsa_mtls (sends CertificateRequest; reads + verifies the client's Certificate+CertificateVerify+Finished)
-> LOG auth result + the verified identity -> send a tiny HTTP body -> exit.
COMPOSES (sovereign): nx_csprng + nx_http_server + nx_tls13_server_session_run_mtls + app_send + nx_mtls_authz.
dependencies 7 imports · 0 importers
imports: nx_syscalls.nxnx_csprng.nxnx_http_server.nxnx_tls13_server_session.nxnx_tls13_server_session_run_mtls.nxnx_tls13_server_session_app_data.nxnx_mtls_authz.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 22 | const NX_MTD_PORT: i64 = 7444 |
| 24 | const NX_MTD_HTTP_RESP: *u8 = "HTTP/1.0 200 OK\r\nContent-Type: text/plain\r\nContent-Length: 8\r\nConnection: close\r\n\r\nMTLS-OK\n" as *u8 |
| 25 | const NX_MTD_HTTP_RESP_N: i64 = 91 |
functions
| 27 | func mtd_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 28 | func mtd_log(s: *u8) -> i64 { sys_write(1, s, mtd_slen(s)); return 0 } |
| 30 | func mtd_log_int(label: *u8, v: i64) -> i64 |
| 46 | func main() -> i64 |