nx_https_client.nx
buildroot/runtime/nx_https_client.nx
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
imports: nx_syscalls.nxnx_http_client.nxnx_url.nx
imported by: nobody (leaf or entry point)
structs
| 82 | struct HttpsResponse |
consts
| 53 | const NX_HTTPS_OK: i64 = 1 |
| 54 | const NX_HTTPS_URL_PARSE_FAIL: i64 = 2 |
| 55 | const NX_HTTPS_DNS_FAIL: i64 = 3 |
| 56 | const NX_HTTPS_CONNECT_FAIL: i64 = 4 |
| 57 | const NX_HTTPS_TLS_HANDSHAKE_FAIL: i64 = 5 |
| 58 | const NX_HTTPS_TLS_CERT_VERIFY_FAIL: i64 = 6 |
| 59 | const NX_HTTPS_SEND_FAIL: i64 = 7 |
| 60 | const NX_HTTPS_RECV_FAIL: i64 = 8 |
| 61 | const NX_HTTPS_RESPONSE_TOO_LARGE: i64 = 9 |
| 62 | const NX_HTTPS_TIMEOUT: i64 = 10 |
| 63 | const NX_HTTPS_REDIRECT_LIMIT: i64 = 11 // too many redirects (caller handles) |
| 98 | const NX_HTTPS_RESPONSE_BYTES: i64 = 104 // 13 fields * 8 bytes |
| 102 | const NX_HTTPS_DEFAULT_MAX_RESPONSE_BYTES: i64 = 67108864 // 64 MB cap |
| 103 | const NX_HTTPS_DEFAULT_TIMEOUT_SECONDS: i64 = 60 |
| 104 | const NX_HTTPS_MAX_REDIRECTS: i64 = 5 |
| 260 | const NX_HTTPS_DEP_URL_PARSE_STATUS: i64 = 1 // SHIPPED (nx_url) |
| 261 | const NX_HTTPS_DEP_DNS_RESOLVE_STATUS: i64 = 2 // SHIPPED (nx_dns) — needs glue function |
| 262 | const NX_HTTPS_DEP_TCP_SOCKET_STATUS: i64 = 1 // SHIPPED (nx_socket) |
| 263 | const NX_HTTPS_DEP_TLS_HANDSHAKE_STATUS: i64 = 1 // SHIPPED (nx_tls13_client_handshake) |
| 264 | const NX_HTTPS_DEP_TLS_RECORD_RW_STATUS: i64 = 1 // SHIPPED (nx_tls13_record) |
| 265 | const NX_HTTPS_DEP_HTTP_BUILD_STATUS: i64 = 1 // SHIPPED (nx_http_client_build_request) |
| 266 | const NX_HTTPS_DEP_HTTP_RESP_PARSE_STATUS: i64 = 1 // SHIPPED (nx_http_resp) |
| 267 | const NX_HTTPS_DEP_CERT_VERIFY_STATUS: i64 = 1 // SHIPPED (nx_tls13_auth) |
| 288 | const NX_HTTPS_TRUST_MODE_PIN_PER_SOURCE: i64 = 1 // strictest |
| 289 | const NX_HTTPS_TRUST_MODE_LE_ONLY: i64 = 2 |
| 290 | const NX_HTTPS_TRUST_MODE_MOZILLA_MIRROR: i64 = 3 |
| 291 | const NX_HTTPS_TRUST_MODE_ANY_CA: i64 = 4 // for testing only |
functions
| 65 | func nx_https_verdict_name(v: i64) -> *u8 |
| 114 | func nx_https_get( |
| 205 | func nx_https_post_json( calls 1: nx_https_get |
| 222 | func nx_https_get_with_api_key( calls 1: nx_https_get |
| 240 | func nx_https_get_polite_pool( calls 1: nx_https_get |
| 293 | func nx_https_trust_mode_name(m: i64) -> *u8 |