code wiki / (root) / nx_acme_http.nx

nx_acme_http.nx

buildroot/runtime/nx_acme_http.nx

16688 B362 linesdepth 19pulls 135 transitivereach 19 importersview sourcekind tooltopic acme
docsdependenciesstructsconstsfunctions

about

nx_acme_http.nx -- reusable ACME transport + tiny JSON string reader. One ACME request = fresh TLS 1.3 connection (LE supports keep-alive but one-shot connections are simplest + robust): url_for_fetch -> url_connect -> session_run (validates the chain via the trust store) -> get/post_ complete -> raw response bytes. The caller parses status/headers/body with nx_http_response_parse + nx_http_response_header + nx_acme_json_str. Composes the proven live-HTTPS stack (same path as the example.com smoke, now reaching LE after the RSA-4096 chain-verify fix). license_tier: ORIGINAL (composes the shipped TLS client + HTTP parser)

dependencies 13 imports · 7 importers

nx_syscalls.nx nx_x509_trust_store.nx nx_trust_store_load_from_certdata. nx_tls13_client_validate_certifica nx_tls13_client_session_run.nx nx_tls12_client_session.nx nx_https_url_for_fetch.nx nx_https_url_connect.nx nx_https_get_complete.nx nx_https_post_complete.nx nx_acme_http.nx nx_acme_issue.nx nx_acme_porkbun.nx nx_mcp_call.nx nx_mgmt_client.nx nx_sovgit_push.nx nx_tls12_porkbun_e2e_gate.nx nx_tls12_reconnect_stress_gate.nx

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

imports: nx_syscalls.nxnx_x509_trust_store.nxnx_trust_store_load_from_certdata.nxnx_tls13_client_validate_certificate.nxnx_tls13_client_session_run.nxnx_tls12_client_session.nxnx_https_url_for_fetch.nxnx_https_url_connect.nxnx_https_get_complete.nxnx_https_post_complete.nxnx_http_client.nxnx_http_response_parse.nxnx_csprng.nx

imported by: nx_acme_issue.nxnx_acme_porkbun.nxnx_mcp_call.nxnx_mgmt_client.nxnx_sovgit_push.nxnx_tls12_porkbun_e2e_gate.nxnx_tls12_reconnect_stress_gate.nx

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

main 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_tag asn1_read_length asn1_read_length ↻ x509_read_tlv sys_mmap ↻ asn1_expect_tag ↻ x509_read_alg_id sys_mmap ↻ asn1_expect_tag ↻

structs

none

consts

27const NX_MAGIC_8192: i64 = 8192
28const NX_MAGIC_20000: i64 = 20000
29const NX_MAGIC_4194304: i64 = 4194304
30const NX_MAGIC_1779284141: i64 = 1779284141
31const NX_MAGIC_65536: i64 = 65536
32const NX_MAGIC_16384: i64 = 16384
34const NX_ACME_HTTP_OK: i64 = 0
35const NX_ACME_HTTP_URL_FAIL: i64 = 0 - 1
36const NX_ACME_HTTP_CONNECT_FAIL: i64 = 0 - 2
37const NX_ACME_HTTP_TLS_FAIL: i64 = 0 - 3
38const NX_ACME_HTTP_IO_FAIL: i64 = 0 - 4
47const NX_ACME_TLS12_MAX_TRIES: i64 = 3
48const NX_ACME_TLS12_RETRY_SETTLE_MS: i64 = 150

functions

58func _acme_http12_roundtrip(
127func nx_acme_req(url: *u8, url_len: i64,
258func nx_acme_json_str(buf: *u8, start: i64, n: i64,
313func main() -> i64