Skip to main content

Module http_trust

Module http_trust 

Source
Expand description

Reqwest builder helper that extends the TLS trust store with certs from NODE_EXTRA_CA_CERTS (with SSL_CERT_FILE as fallback) to match native claudeโ€™s TLS trust behaviour.

Forge makes outbound HTTPS from several call sites (oauth usage probe, service-status check, CLI-version probe). These use reqwest, which by default trusts webpki-roots + system roots only - neither covers a mitmproxy / Zscaler / Palo Alto / corporate CA setup that the user has wired up via NODE_EXTRA_CA_CERTS. The native claude binary (Node) honours that env var unconditionally; forge needs the same behaviour for interoperability with the corporate CA configurations users already have running.

Apply at every reqwest client construction site via with_extra_roots(reqwest::Client::builder().timeout(โ€ฆ)).

Re-exportsยง

use std::fs; ๐Ÿ”’

Functionsยง

with_extra_roots
Extend a reqwest ClientBuilder with PEM certs from the NODE_EXTRA_CA_CERTS env var (falls back to SSL_CERT_FILE).
with_roots_from ๐Ÿ”’
Load one bundle into b, returning the builder and how many certificates it added. Unreadable or unparseable bundles add nothing.