Skip to content

fix(fetch): support corporate proxies with TLS interception#3330

Open
sleicht wants to merge 1 commit into
tailcallhq:mainfrom
sleicht:fix/fetch-proxy-support
Open

fix(fetch): support corporate proxies with TLS interception#3330
sleicht wants to merge 1 commit into
tailcallhq:mainfrom
sleicht:fix/fetch-proxy-support

Conversation

@sleicht
Copy link
Copy Markdown

@sleicht sleicht commented May 13, 2026

Summary

The fetch tool's HTTP client was created via bare Client::new(), which caused two failures in corporate proxy environments:

  1. Hickory-DNS bypasses proxy: The workspace-wide hickory-dns cargo feature made the client perform direct DNS resolution, bypassing HTTP_PROXY/HTTPS_PROXY environment variables entirely.

  2. Corporate CA not trusted: The rustls-tls backend only trusts the webpki-roots CA bundle, so proxies that perform TLS interception (MITM) have their re-signed certificates rejected.

Fix

  • Call .hickory_dns(false) on the client builder to delegate DNS to the system resolver / configured proxy.
  • Load additional root CA certificates from well-known environment variables so corporate proxy CAs are trusted:
    1. FORGE_ROOT_CERT_PATHS — comma-separated list of PEM/DER paths (Forge-specific)
    2. SSL_CERT_FILE — single PEM bundle (common convention)
    3. NODE_EXTRA_CA_CERTS — single PEM file (Node.js convention)
    4. REQUESTS_CA_BUNDLE — single PEM bundle (Python convention)

Testing

Verified working in a corporate environment with:

  • HTTP proxy (HTTP_PROXY/HTTPS_PROXY set to http://proxy:8080)
  • TLS-intercepting proxy (Swisscom Proxy Sub CA re-signing certificates)
  • NODE_EXTRA_CA_CERTS pointing to the corporate CA PEM file

Before this fix, every fetch call failed with error sending request for url. After the fix, fetches work correctly through the proxy.

Related

The fetch tool's HTTP client was created via bare `Client::new()`,
which caused two failures in corporate proxy environments:

1. The workspace-wide `hickory-dns` cargo feature made the client
   perform direct DNS resolution, bypassing HTTP_PROXY/HTTPS_PROXY
   environment variables entirely.

2. The `rustls-tls` backend only trusts the webpki-roots CA bundle,
   so proxies that perform TLS interception (MITM) have their
   re-signed certificates rejected.

Fix by:
- Calling `.hickory_dns(false)` to delegate DNS to the system
  resolver / configured proxy.
- Loading additional root CA certificates from well-known environment
  variables (FORGE_ROOT_CERT_PATHS, SSL_CERT_FILE,
  NODE_EXTRA_CA_CERTS, REQUESTS_CA_BUNDLE) so corporate proxy CAs
  are trusted.

Fixes tailcallhq#3329
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 13, 2026

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions Bot added the type: fix Iterations on existing features or infrastructure. label May 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: fix Iterations on existing features or infrastructure.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Fetch tool ignores HTTP_PROXY/HTTPS_PROXY — uses bare reqwest::Client bypassing proxy configuration

2 participants