Skip to main content

Module relay_client

Module relay_client 

Source
Expand description

HTTP client for wire-relay-server.

Sync wrapper around reqwest::blocking so CLI commands stay synchronous — the only async surface in the crate is relay_server::serve. Async clients land in v0.2 if a long-running daemon needs them.

Structs§

AllocateResponse
PostEventResponse
RelayClient

Constants§

INSECURE_SKIP_TLS_ENV
Env var: when set to a truthy value (1, true, yes), every TLS verification check on every wire HTTPS client is disabled. Intended as an emergency-only operator override for environments behind a TLS-intercepting middlebox (corporate proxy, AV product like Avast re-signing certs with its own root, captive portal). Prints a loud stderr banner on every send when active. Do not set this in production. Documented in THREAT_MODEL.md + README.

Functions§

build_blocking_client
Centralized builder for blocking HTTPS clients across wire. Loads the OS native trust store (rustls-tls-native-roots) so corporate proxies, AV cert-resign products, and on-prem CAs validate. Honors the INSECURE_SKIP_TLS_ENV escape hatch for the corporate-proxy emergency case.
format_transport_error
Flatten an anyhow::Error source chain into a single human-readable transport-error line for the reason field in wire push --json and for stderr surfaces. Classifies the topmost cause (TLS error, DNS error, connect timeout, read timeout, HTTP error) so a silent failure no longer leaks past the user as a bare URL.