code wiki / (root) / nx_https_get_cli.nx

nx_https_get_cli.nx

buildroot/runtime/nx_https_get_cli.nx

4984 B105 linesdepth 21pulls 138 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 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_close nx_nss_certdata_parse sys_mmap ↻ _pat_class_cert _pat_value_octal _pat_end _find_newline _starts_with _parse_octal_line sys_mmap ↻ _is_space _decode_octal_escape _is_octal trust_store_alloc sys_mmap ↻ nx_x509_trust_store_load sys_mmap ↻ x509_parse sys_mmap ↻ asn1_cursor_init asn1_expect_tag sys_mmap ↻ asn1_read_tlv_header asn1_read_length x509_read_tlv

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
26const HGC_OUTCAP: i64 = 4194304 // 4 MiB response cap

functions

28func hgc_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 1: hgc_put
29func hgc_put(s: *u8) -> i64 { sys_write(1, s, hgc_slen(s)); return 0 }
called by 1: main calls 2: sys_writehgc_slen
30func hgc_putn(v: i64) -> i64
44func main(argc: i64, argv: *i64) -> i64
78func hgc_parse_ipport(s: *u8, ip_out: *i64, port_out: *i64) -> i64
called by 1: main