add proxy support #7335

Open
opened 2026-02-16 18:06:53 -05:00 by yindo · 5 comments
Owner

Originally created by @mroussamamessabih-1337 on GitHub (Jan 23, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

Hi team,

when I use opencode behind an enterprise proxy I'm getting this error

(base) PS C:\Users\s494709\AppData\Local\OpenCode> .\opencode-cli.exe
{
  "name": "UnknownError",
  "data": {
    "message": "Error: self signed certificate in certificate chain"
  }
}

Can you please add proxy support?

Plugins

No response

OpenCode version

latest

Steps to reproduce

No response

Screenshot and/or share link

(base) PS C:\Users\s494709\AppData\Local\OpenCode> .\opencode-cli.exe
{
"name": "UnknownError",
"data": {
"message": "Error: self signed certificate in certificate chain"
}
}

Operating System

Windows 11

Terminal

powershell

Originally created by @mroussamamessabih-1337 on GitHub (Jan 23, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description Hi team, when I use opencode behind an enterprise proxy I'm getting this error ``` (base) PS C:\Users\s494709\AppData\Local\OpenCode> .\opencode-cli.exe { "name": "UnknownError", "data": { "message": "Error: self signed certificate in certificate chain" } } ``` Can you please add proxy support? ### Plugins _No response_ ### OpenCode version latest ### Steps to reproduce _No response_ ### Screenshot and/or share link (base) PS C:\Users\s494709\AppData\Local\OpenCode> .\opencode-cli.exe { "name": "UnknownError", "data": { "message": "Error: self signed certificate in certificate chain" } } ### Operating System Windows 11 ### Terminal powershell
yindo added the windowsbug labels 2026-02-16 18:06:53 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 23, 2026):

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

  • #531: Support HTTP_PROXY & HTTPS_PROXY for millions of users who are behind fire walls in some regions and some organizations
  • #9736: [FEATURE]: opencode proxy
  • #3130: SSL_CERT_FILE env not observed since v0.15.0 (handles self-signed certificates in proxy scenarios)
  • #7073: self signed certificate in certificate chain (closed, but related to your error message)
  • #4883: Error: unable to verify the first certificate
  • #4924: Is it possible to use proxy?

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Jan 23, 2026): This issue might be a duplicate of existing issues. Please check: - #531: Support HTTP_PROXY & HTTPS_PROXY for millions of users who are behind fire walls in some regions and some organizations - #9736: [FEATURE]: opencode proxy - #3130: SSL_CERT_FILE env not observed since v0.15.0 (handles self-signed certificates in proxy scenarios) - #7073: self signed certificate in certificate chain (closed, but related to your error message) - #4883: Error: unable to verify the first certificate - #4924: Is it possible to use proxy? Feel free to ignore if none of these address your specific case.
Author
Owner

@rekram1-node commented on GitHub (Jan 27, 2026):

Did you see our docs on network stuff?

https://opencode.ai/docs/network/#custom-certificates

@rekram1-node commented on GitHub (Jan 27, 2026): Did you see our docs on network stuff? https://opencode.ai/docs/network/#custom-certificates
Author
Owner

@Thesam1798 commented on GitHub (Jan 27, 2026):

Fix available in PR #10856

I implemented proxy support in PR #10856.

My use case: corporate proxy where HTTPS_PROXY is set in the environment.

Before the fix:

  • Couldn't use opencode at all - all network calls failed
  • Providers couldn't reach their APIs
  • Startup failures (version check, ripgrep download, etc.)

After the fix:

  • Opencode automatically detects HTTP_PROXY/HTTPS_PROXY variables
  • No additional configuration needed
  • NO_PROXY support for internal hosts
  • Everything works perfectly!

I'm currently using a locally built version while waiting for the merge. The PR also includes TLS support for proxies with custom/self-signed certificates.

@Thesam1798 commented on GitHub (Jan 27, 2026): ## Fix available in PR #10856 I implemented proxy support in PR #10856. **My use case:** corporate proxy where `HTTPS_PROXY` is set in the environment. **Before the fix:** - Couldn't use opencode at all - all network calls failed - Providers couldn't reach their APIs - Startup failures (version check, ripgrep download, etc.) **After the fix:** - Opencode automatically detects `HTTP_PROXY`/`HTTPS_PROXY` variables - No additional configuration needed - `NO_PROXY` support for internal hosts - Everything works perfectly! I'm currently using a locally built version while waiting for the merge. The PR also includes TLS support for proxies with custom/self-signed certificates.
Author
Owner

@ashenstrata commented on GitHub (Jan 28, 2026):

I hate how this is solved in the PR but I'd really like to have some working solution. Right now opencode (TUI specifically) does not work well in some network setups (including corporate environments). I'm experiencing painfully slow startup times and failing requests, amongst issues with proxy configuration

@ashenstrata commented on GitHub (Jan 28, 2026): I hate how this is solved in the PR but I'd really like to have some working solution. Right now opencode (TUI specifically) does not work well in some network setups (including corporate environments). I'm experiencing painfully slow startup times and failing requests, amongst issues with proxy configuration
Author
Owner

@presmihaylov commented on GitHub (Feb 2, 2026):

I'm also waiting on this, I'm running opencode in a sandbox and proxying all secrets (including opencode api key) via a http proxy for security purposes and this breaks my setup. I will deploy the custom version from the open PR in the meantime

@presmihaylov commented on GitHub (Feb 2, 2026): I'm also waiting on this, I'm running opencode in a sandbox and proxying all secrets (including opencode api key) via a http proxy for security purposes and this breaks my setup. I will deploy the custom version from the open PR in the meantime
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#7335