opencode icon indicating copy to clipboard operation
opencode copied to clipboard

Use local SSL trust store

Open Clete2 opened this issue 5 months ago • 7 comments

I am using opencode with a LiteLLM proxy that has a SSL cert signed internally by my corporate organization.

When I try to test it, I get an error message: "UnknownError Error: unable to get local issuer certificate"

Image

When I cURL the LiteLLM proxy URL, it works, because the certificate is signed by a trusted signer. Opencode should use my system truststore.

macOS Sequoia 15.6

(PS I also am having #1154 as an issue, which might be related, I am not sure)

Clete2 avatar Aug 07 '25 23:08 Clete2

For now I can work around it with "NODE_TLS_REJECT_UNAUTHORIZED=0"

Clete2 avatar Aug 08 '25 11:08 Clete2

does setting NODE_EXTRA_CA_CERTS fix?

thdxr avatar Aug 11 '25 15:08 thdxr

@thdxr yes, but most apps just use system store without having to specify.

~> opencode # error
~> NODE_EXTRA_CA_CERTS=truststore.crt opencode # works

I'm not familiar with what HTTP libraries are being used, but maybe there's one that can use system certs?

For instance, when using npm, I connect to a custom package proxy URL which has a company-signed SSL cert, and I don't have any special configuration that I know of which makes it trust that cert.

Setup is like... Mac -> Zscaler -> GitHub Copilot. SSL decrypt enabled, so the destination appears to have a company-signed certifiate.

Clete2 avatar Aug 12 '25 12:08 Clete2

this isn't something bun or node seems to do automatically. need to see if we can load it somehow

thdxr avatar Aug 12 '25 18:08 thdxr

I am also getting this! This will need to be fixed for many corporate settings :)

james-gour avatar Oct 24 '25 19:10 james-gour

NODE_OPTIONS="--use-system-ca" or BUN_OPTIONS="--use-system-ca" should allow use of local corporate proxy certificates stored in the system security store. https://nodejs.org/docs/v23.8.0/api/cli.html#--use-system-ca

This option was added to node in v22/23 this year which sadly means some LLMs with 2024 knowledge still think it's impossible 😂

maxious avatar Dec 23 '25 09:12 maxious

Same issue here, deep wiki failing over http due to corporate proxy,, can't set in ENV variables without allowing insecure TLS.

davidw-philips avatar Jan 05 '26 09:01 davidw-philips