code wiki / (root) / nx_https_client.nx

nx_https_client.nx

buildroot/runtime/nx_https_client.nx

12499 B299 linesdepth 6pulls 10 transitivereach 0 importersview sourcekind orphan librarytopic https
docsdependenciesstructsconstsfunctions

about

nx_https_client.nx -- HTTPS convenience wrapper (TLS+DNS glue). module: nishi-core.net.https_client depends: nishi-core.net.http_client, nishi-core.crypto.tls13_client, nishi-core.net.dns, nishi-core.io.url, nishi-core.io.syscalls disk_kb: 5 capability: CORE_NET license_tier: PUBLIC_NISHI_SUBSTRATE genealogy_id: rfc_7230_http_1_1 + rfc_8446_tls_1_3 + rfc_1035_dns + rfc_3986_uri_generic + nishi_substrate_phase_8_tls_http_dns_wiring_2026 The "Phase 8" substrate wiring per nx_http_client.nx's own header note: glue layer composing existing shipped substrate (nx_http_client HTTP/1.1 + nx_tls13_client TLS 1.3 + nx_dns DNS resolution + nx_url URL parsing) into a single HTTPS GET entry-point. This is the SUBSTRATE PHASE 8 UNBLOCK that every NX-INGEST adapter has been honest-stubbing against. Once this primitive ships, the honest-stub fetch lines in all 10 agronomic adapters can swap to real nx_https_get() calls with NO caller-side API change per Cardinal 19 (API contract stability). ===== Architecture =============================================== Caller invokes nx_https_get(url_ptr, url_len, out_buf, out_cap): 1. Parse URL into (scheme, host, port, path, query) via nx_url 2. Resolve host → IPv4 via nx_dns_resolve 3. TCP connect to (IPv4, port) via nx_socket 4. TLS 1.3 handshake via nx_tls13_client_handshake 5. Inside the TLS session, send HTTP/1.1 GET via nx_http_client 6. Read TLS-wrapped HTTP response 7. Close TLS session + TCP socket cleanly 8. Return response bytes + verdict to caller All steps are bits-up NishiLang substrate composition. Zero third-party deps (no libcurl, no OpenSSL, no Go net/http).

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_http_client.nx nx_url.nx nx_https_client.nx

imports: nx_syscalls.nxnx_http_client.nxnx_url.nx

imported by: nobody (leaf or entry point)

structs

82struct HttpsResponse

consts

53const NX_HTTPS_OK: i64 = 1
54const NX_HTTPS_URL_PARSE_FAIL: i64 = 2
55const NX_HTTPS_DNS_FAIL: i64 = 3
56const NX_HTTPS_CONNECT_FAIL: i64 = 4
57const NX_HTTPS_TLS_HANDSHAKE_FAIL: i64 = 5
58const NX_HTTPS_TLS_CERT_VERIFY_FAIL: i64 = 6
59const NX_HTTPS_SEND_FAIL: i64 = 7
60const NX_HTTPS_RECV_FAIL: i64 = 8
61const NX_HTTPS_RESPONSE_TOO_LARGE: i64 = 9
62const NX_HTTPS_TIMEOUT: i64 = 10
63const NX_HTTPS_REDIRECT_LIMIT: i64 = 11 // too many redirects (caller handles)
98const NX_HTTPS_RESPONSE_BYTES: i64 = 104 // 13 fields * 8 bytes
102const NX_HTTPS_DEFAULT_MAX_RESPONSE_BYTES: i64 = 67108864 // 64 MB cap
103const NX_HTTPS_DEFAULT_TIMEOUT_SECONDS: i64 = 60
104const NX_HTTPS_MAX_REDIRECTS: i64 = 5
260const NX_HTTPS_DEP_URL_PARSE_STATUS: i64 = 1 // SHIPPED (nx_url)
261const NX_HTTPS_DEP_DNS_RESOLVE_STATUS: i64 = 2 // SHIPPED (nx_dns) — needs glue function
262const NX_HTTPS_DEP_TCP_SOCKET_STATUS: i64 = 1 // SHIPPED (nx_socket)
263const NX_HTTPS_DEP_TLS_HANDSHAKE_STATUS: i64 = 1 // SHIPPED (nx_tls13_client_handshake)
264const NX_HTTPS_DEP_TLS_RECORD_RW_STATUS: i64 = 1 // SHIPPED (nx_tls13_record)
265const NX_HTTPS_DEP_HTTP_BUILD_STATUS: i64 = 1 // SHIPPED (nx_http_client_build_request)
266const NX_HTTPS_DEP_HTTP_RESP_PARSE_STATUS: i64 = 1 // SHIPPED (nx_http_resp)
267const NX_HTTPS_DEP_CERT_VERIFY_STATUS: i64 = 1 // SHIPPED (nx_tls13_auth)
288const NX_HTTPS_TRUST_MODE_PIN_PER_SOURCE: i64 = 1 // strictest
289const NX_HTTPS_TRUST_MODE_LE_ONLY: i64 = 2
290const NX_HTTPS_TRUST_MODE_MOZILLA_MIRROR: i64 = 3
291const NX_HTTPS_TRUST_MODE_ANY_CA: i64 = 4 // for testing only

functions

65func nx_https_verdict_name(v: i64) -> *u8
114func nx_https_get(
205func nx_https_post_json(
calls 1: nx_https_get
222func nx_https_get_with_api_key(
calls 1: nx_https_get
240func nx_https_get_polite_pool(
calls 1: nx_https_get
293func nx_https_trust_mode_name(m: i64) -> *u8