Skip to content

Corporate proxy support + network errors that tell you what happened #83

Description

@jpbelmo

The CLI's first-run audit found its most likely abandonment point, and it's not detection: it's login behind a corporate proxy. Exactly our primary user (a developer on managed IT, NDA repo) is the one most likely to hit it.

Today:

  • src/http-client.ts uses bare fetch, and Node's fetch ignores HTTP_PROXY/HTTPS_PROXY env vars entirely. Behind a mandatory proxy, every request fails at connect.
  • TLS-intercepting proxies (corporate CA) work only if the user already knows about NODE_EXTRA_CA_CERTS, which our docs never mention.
  • Every network failure (proxy, DNS, TLS interception, refused connection) collapses into the same message: Could not reach <host>. The cause is discarded on purpose so we never leak token material into errors, and that constraint stays. But cause-free means undiagnosable.

The work, likely 2-3 PRs:

  1. Honor HTTP_PROXY/HTTPS_PROXY/NO_PROXY via undici's ProxyAgent (no new dependency: undici ships inside Node). Login/submit only; scan has no network by design and never will.
  2. Differentiated error messages that name the failure class without echoing anything sensitive: "connection refused", "could not verify TLS certificate (corporate proxy? see docs)", "proxy required". Stack traces stay banned; token material stays out.
  3. A short docs/corporate-networks.md: proxy env vars, NODE_EXTRA_CA_CERTS, and the submit visibility-probe edge where a captive proxy answers 200 for everything.

Touches network code, so the privacy gate and reviewer pass apply, and test/privacy/zero-network.test.ts must stay green (the proxy agent may only exist inside the login/submit allowlist). @rudi193-cmd this smells like your kind of plumbing if you want it; open to anyone otherwise, pick a slice and comment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestup-for-grabsStandalone, well-scoped, and ready for a first-time contributor

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions