code wiki / (root) / nx_https_get_cli.nx

nx_https_get_cli.nx

buildroot/runtime/nx_https_get_cli.nx

9784 B181 linesdepth 21pulls 150 transitivereach 0 importersview sourcekind tooltopic https
docsdependenciesstructsconstsfunctions

about

nx_https_get_cli.nx -- the OPERATOR/MCP-facing sovereign HTTPS fetch (replaces WebFetch + curl). nx_https_get <url> [connect-host:port] <url> fetched over OUR TLS 1.3 + Mozilla trust store; raw response (status+headers+body) to stdout. [connect-host:port] OPTIONAL connect override (curl --connect-to): open the TCP+TLS to THIS endpoint while keeping SNI + Host + cert-name = the URL's host. Lets us fetch our OWN vhosts straight from the sovereign edge (sites.elf 127.0.0.1:8443), bypassing the DSM nginx that also squats :443 for unclaimed SNIs (andelinwest.com internally hit DSM's self-signed cert). The tools daemon fork-execs this on a GREEN tool_allowlist.conf row, cap-gated to nx_https_get, and returns stdout as the tools/call result. Uses PRODUCTION entropy (nx_csprng_fill from /dev/urandom). license_tier: ORIGINAL

dependencies 12 imports · 0 importers

nx_syscalls.nx nx_csprng.nx nx_x509_trust_store.nx nx_trust_store_load_from_certdata. nx_tls13_client_validate_certifica nx_tls13_client_session_run.nx nx_tls13_chrome_session.nx nx_https_url_for_fetch.nx nx_https_url_connect.nx nx_https_get_complete.nx nx_https_get_cli.nx

diagram shows first 10 each side; +2 more imports, +0 more importers in the complete lists below.

imports: nx_syscalls.nxnx_csprng.nxnx_x509_trust_store.nxnx_trust_store_load_from_certdata.nxnx_tls13_client_validate_certificate.nxnx_tls13_client_session_run.nxnx_tls13_chrome_session.nxnx_https_url_for_fetch.nxnx_https_url_connect.nxnx_https_get_complete.nxnx_tls_cert_cache.nxnx_https_fetch_lib.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main hgc_put sys_write hgc_slen sys_now_realtime_sec sys_mmap nxa_die sys_write ↻ sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ sys_clock_gettime_real hf_store_load nx_trust_store_load_from_c sys_mmap ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_munmap sys_close nx_nss_certdata_parse sys_mmap ↻ _pat_class_cert _pat_value_octal _pat_end _find_newline _starts_with _parse_octal_line sys_mmap ↻

structs

none

consts

22const HGC_MAGIC_4194304: i64 = 4194304
23const HGC_MAGIC_65535: i64 = 65535
25const HGC_CERTDATA: *u8 = "data/mozilla_certdata.txt" as *u8
29const HGC_OUTCAP: i64 = 33554432

functions

31func hgc_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 2: hgc_putmain
32func hgc_streq(a: *u8, b: *u8) -> i64
called by 1: main
38func hgc_put(s: *u8) -> i64 { sys_write(1, s, hgc_slen(s)); return 0 }
called by 1: main calls 2: sys_writehgc_slen
39func hgc_putn(v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
53func main(argc: i64, argv: *i64) -> i64
154func hgc_parse_ipport(s: *u8, ip_out: *i64, port_out: *i64) -> i64
called by 1: main