Repository navigation
Description
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-cais 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-caSo 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
- On Windows, enable v2rayN with PAC mode or system proxy mode
- Start OpenCode desktop normally
- Try to authorize GitHub Copilot
- 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 OpenCodeExpected 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
github-actions commentedon May 10, 2026
This issue doesn't fully meet our contributing guidelines.
What needs to be fixed:
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.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.
github-actions commentedon May 10, 2026
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.