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
ClientBuilderwith PEM certs from theNODE_EXTRA_CA_CERTSenv var (falls back toSSL_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.