Skip to content

GitHub Copilot OAuth fails on Windows behind v2rayN/system proxy unless HTTP_PROXY/HTTPS_PROXY are set explicitly #26629

Closed as not planned

Description

@leiyu1980

Summary

When I use GitHub Copilot authorization in the Windows desktop app, OAuth fails with a TLS certificate verification error unless I explicitly launch the app with HTTP_PROXY / HTTPS_PROXY environment variables set.

This happens even when:

  • browser access works normally on the same machine
  • v2rayN is enabled in system proxy mode
  • NODE_OPTIONS=--use-system-ca is already set

Setting explicit proxy env vars fixes it:

HTTPS_PROXY=http://127.0.0.1:<http-proxy-port>
HTTP_PROXY=http://127.0.0.1:<http-proxy-port>
NO_PROXY=localhost,127.0.0.1,::1
NODE_OPTIONS=--use-system-ca

So this looks like the desktop app / sidecar path for GitHub Copilot OAuth depends on standard proxy env vars and does not work reliably with Windows system proxy / PAC-style proxy setups.


Environment

  • OS: Windows
  • App: OpenCode desktop app 1.14.45
  • Proxy tool: v2rayN 7.3.2
  • Proxy modes tested:
    • PAC mode: fails
    • system proxy mode: still fails
    • explicit HTTP_PROXY / HTTPS_PROXY: works
  • Auth flow: GitHub Copilot authorization
  • NODE_OPTIONS=--use-system-ca: tested

Error

ERROR 2026-05-10T00:37:16 +14175ms service=server error=fetch failed Caused by: unable to verify the first certificate; if the root CA is installed locally, try running Node.js with --use-system-ca cause=TypeError: fetch failed
    at ProviderAuth.authorize (...)
...
[cause]: Error: unable to verify the first certificate; if the root CA is installed locally, try running Node.js with --use-system-ca
      at TLSSocket.onConnectSecure (node:internal/tls/wrap:1653:34)
...

Reproduction

  1. On Windows, enable v2rayN with PAC mode or system proxy mode
  2. Start OpenCode desktop normally
  3. Try to authorize GitHub Copilot
  4. Observe OAuth failure with certificate verification error

Workaround

Launching the app with explicit proxy env vars works:

$env:HTTPS_PROXY="http://127.0.0.1:<http-proxy-port>"
$env:HTTP_PROXY="http://127.0.0.1:<http-proxy-port>"
$env:NO_PROXY="localhost,127.0.0.1,::1"
$env:NODE_OPTIONS="--use-system-ca"
# then start OpenCode

Expected behavior

GitHub Copilot OAuth should work in the desktop app when Windows system proxy is active, without requiring users to manually set HTTP_PROXY / HTTPS_PROXY every time.

At minimum, it would be helpful if the app:

  • handled Windows system proxy / PAC more reliably for Node/Electron-side OAuth requests, or
  • exposed proxy settings in the desktop app, or
  • showed a clearer error message suggesting explicit proxy env vars as a workaround

Notes

I checked the repo and saw that the desktop app appears to load system certificates and call Node proxy-from-env behavior, which is probably why explicit env vars work. The problem seems to be that system proxy / PAC alone is not sufficient for this OAuth path.

Activity

  1. github-actions commented on May 10, 2026

    @github-actions
    Contributor

    This issue doesn't fully meet our contributing guidelines.

    What needs to be fixed:

    • The description begins with meta-text ("可以,下面这份可以直接发到 anomalyco/opencode。") indicating this was AI-generated content that was copy-pasted without cleanup. Please write your bug report in your own words describing what you actually experienced.
    • The standard template fields (OpenCode version, Operating System, Terminal, Steps to reproduce) are all left as "No response" while the same information appears in a custom format above — please fill in the actual template fields so maintainers can quickly find key details.

    Please edit this issue to address the above within 2 hours, or it will be automatically closed.


    This issue might be a duplicate of existing issues. Please check:

    If you believe this was flagged incorrectly, please let a maintainer know.

  2. added
    needs:compliance
    on May 10, 2026
  3. github-actions commented on May 10, 2026

    @github-actions
    Contributor

    This issue has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.

    Feel free to open a new issue that follows our issue templates.

  4. removed
    needs:compliance
    on May 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions