Testing APIs behind a corporate proxy or with a company CA
Everything works at home. Then you open the laptop at the office, and every request fails with ECONNREFUSED, a timeout, or self-signed certificate in certificate chain. Corporate networks add two things most API tools don't expect: an HTTP proxy in front of the internet, and TLS inspection with the company's own certificate authority.
Symptom → cause
| What you see | What's going on |
|---|---|
| Timeouts or connection refused to public APIs, but internal hosts work | Outbound traffic must go through a proxy |
self-signed certificate in certificate chain, unable to get local issuer certificate | A TLS-inspecting proxy re-signs traffic with a company CA your tool doesn't trust |
407 Proxy Authentication Required | The proxy needs credentials |
| Internal host names don't resolve | You're off the VPN, or using the browser-based app (see below) |
Route requests through the proxy
With the CLI, pass the proxy explicitly:
requestarium run-collection "Partner API" --env Staging --proxy http://proxy.corp.example:3128With proxy credentials:
requestarium run-collection "Partner API" --env Staging \
--proxy "http://$PROXY_USER:[email protected]:3128"Trust the company CA, don't disable checks
If your company inspects TLS, its proxy presents certificates signed by an internal CA. Get that CA certificate from IT (usually a .pem or .crt file; it's often already in your OS keychain) and trust it:
requestarium run-collection "Partner API" --env Staging \
--proxy http://proxy.corp.example:3128 \
--ca-cert ~/certs/corp-root-ca.pem--ca-cert adds the company CA to the trusted authorities; public certificates are still verified as usual.
Internal and VPN-only APIs
The desktop app, the IDE extensions and the CLI send requests from your computer. If your machine can reach https://orders.internal.corp, so can they: VPN hosts, private DNS, localhost and docker-compose services all work.
The browser version of the app sends requests through the Requestarium server instead, which can only reach public addresses. For internal APIs, use the desktop app or the CLI. See Testing APIs on localhost and docker-compose.
In CI runners
Self-hosted CI runners inside a corporate network need the same flags. Put them in the job once:
- run: |
requestarium run-collection "Partner API" --env Staging \
--proxy "$HTTPS_PROXY" --ca-cert /etc/ssl/certs/corp-root-ca.pem --junit results.xmlCombine with --cert and --key if the partner API also requires a client certificate. See Testing APIs that need client certificates.