opencode fails to start after chocolatey install: HTTPThread: the CA is invalid #1971

Open
opened 2026-02-16 17:33:30 -05:00 by yindo · 6 comments
Owner

Originally created by @Mattwmaster58 on GitHub (Oct 6, 2025).

Originally assigned to: @itsrainingmani on GitHub.

possibly related to: https://github.com/oven-sh/bun/issues/17325

INFO  2025-10-06T15:06:52 +70ms service=default version=0.14.3 args=[] opencode
INFO  2025-10-06T15:06:52 +0ms service=project directory=C:\Users\<my username> fromDirectory
INFO  2025-10-06T15:06:52 +7ms service=config path=C:\Users\<my username>\.config\opencode\config.json loading
INFO  2025-10-06T15:06:52 +1ms service=config path=C:\Users\<my username>\.config\opencode\opencode.json loading
INFO  2025-10-06T15:06:52 +0ms service=config path=C:\Users\<my username>\.config\opencode\opencode.jsonc loading
INFO  2025-10-06T15:06:52 +3ms service=plugin path=opencode-copilot-auth@0.0.3 loading plugin
INFO  2025-10-06T15:06:52 +0ms service=bun pkg=opencode-copilot-auth version=0.0.3 installing package using Bun's default registry resolution
INFO  2025-10-06T15:06:52 +0ms service=bun cmd=["C:\\ProgramData\\chocolatey\\lib\\opencode\\tools\\opencode.exe","add","--force","--exact","--cwd","C:\\Users\\<my username>\\.cache\\opencode","opencode-copilot-auth@0.0.3"] cwd=C:\Users\<my username>\.cache\opencode running
INFO  2025-10-06T15:06:52 +51ms service=bun code=1 stdout=bun add v1.2.21 (7c45ed97)
 stderr=Resolving dependencies
HTTPThread: the CA is invalid
 done
ERROR 2025-10-06T15:06:52 +2ms service=default pkg=opencode-copilot-auth version=0.0.3 name=BunInstallFailedError message=BunInstallFailedError cause=Error: Command failed with exit code 1 stack=BunInstallFailedError: BunInstallFailedError
    at new NamedError (unknown:1:28)
    at new BunInstallFailedError (B:/~BUN/root/index.js:61352:14)
    at <anonymous> (B:/~BUN/root/index.js:62739:43)
    at processTicksAndRejections (native:7:39) fatal

Different than #1694 I think - opencode doesn't even start

Windows 11, behind Cloudflare WARP

NODE_TLS_REJECT_UNAUTHORIZED=0 doesn't fix this

Setting NODE_EXTRA_CA_CERTS (ex setx NODE_EXTRA_CA_CERTS C:\ProgramData\Cloudflare\installed_cert.pem) also doesn't work, which is what I would expect based on that linked bun issue - there doesn't seem to be an easy workaround here.

Originally created by @Mattwmaster58 on GitHub (Oct 6, 2025). Originally assigned to: @itsrainingmani on GitHub. possibly related to: https://github.com/oven-sh/bun/issues/17325 ``` INFO 2025-10-06T15:06:52 +70ms service=default version=0.14.3 args=[] opencode INFO 2025-10-06T15:06:52 +0ms service=project directory=C:\Users\<my username> fromDirectory INFO 2025-10-06T15:06:52 +7ms service=config path=C:\Users\<my username>\.config\opencode\config.json loading INFO 2025-10-06T15:06:52 +1ms service=config path=C:\Users\<my username>\.config\opencode\opencode.json loading INFO 2025-10-06T15:06:52 +0ms service=config path=C:\Users\<my username>\.config\opencode\opencode.jsonc loading INFO 2025-10-06T15:06:52 +3ms service=plugin path=opencode-copilot-auth@0.0.3 loading plugin INFO 2025-10-06T15:06:52 +0ms service=bun pkg=opencode-copilot-auth version=0.0.3 installing package using Bun's default registry resolution INFO 2025-10-06T15:06:52 +0ms service=bun cmd=["C:\\ProgramData\\chocolatey\\lib\\opencode\\tools\\opencode.exe","add","--force","--exact","--cwd","C:\\Users\\<my username>\\.cache\\opencode","opencode-copilot-auth@0.0.3"] cwd=C:\Users\<my username>\.cache\opencode running INFO 2025-10-06T15:06:52 +51ms service=bun code=1 stdout=bun add v1.2.21 (7c45ed97) stderr=Resolving dependencies HTTPThread: the CA is invalid done ERROR 2025-10-06T15:06:52 +2ms service=default pkg=opencode-copilot-auth version=0.0.3 name=BunInstallFailedError message=BunInstallFailedError cause=Error: Command failed with exit code 1 stack=BunInstallFailedError: BunInstallFailedError at new NamedError (unknown:1:28) at new BunInstallFailedError (B:/~BUN/root/index.js:61352:14) at <anonymous> (B:/~BUN/root/index.js:62739:43) at processTicksAndRejections (native:7:39) fatal ``` Different than #1694 I think - opencode doesn't even start Windows 11, behind Cloudflare WARP `NODE_TLS_REJECT_UNAUTHORIZED=0` doesn't fix this Setting `NODE_EXTRA_CA_CERTS` (ex `setx NODE_EXTRA_CA_CERTS C:\ProgramData\Cloudflare\installed_cert.pem`) also doesn't work, which is what I would expect based on that linked bun issue - there doesn't seem to be an easy workaround here.
yindo added the windows label 2026-02-16 17:33:30 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Oct 6, 2025):

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

  • #2765: Very similar BunInstallFailedError with HTTPThread CA certificate issues - shows "HTTPThread: could not find CA file: '/Users/{user}/bundle.pem'"
  • #1694: SSL certificate trust store issues with "unable to get local issuer certificate" error
  • #640: Corporate proxy SSL/certificate chain issues with "self signed certificate in certificate chain"
  • #923: Related certificate chain validation problems when accessing websites

These issues all relate to certificate validation problems in different network environments. The #2765 issue in particular shows the same HTTPThread error pattern you're experiencing.

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

@github-actions[bot] commented on GitHub (Oct 6, 2025): This issue might be a duplicate of existing issues. Please check: - #2765: Very similar BunInstallFailedError with HTTPThread CA certificate issues - shows "HTTPThread: could not find CA file: '/Users/{user}/bundle.pem'" - #1694: SSL certificate trust store issues with "unable to get local issuer certificate" error - #640: Corporate proxy SSL/certificate chain issues with "self signed certificate in certificate chain" - #923: Related certificate chain validation problems when accessing websites These issues all relate to certificate validation problems in different network environments. The #2765 issue in particular shows the same HTTPThread error pattern you're experiencing. Feel free to ignore if none of these address your specific case.
Author
Owner

@rekram1-node commented on GitHub (Oct 6, 2025):

@itsrainingmani can probably help best here

@rekram1-node commented on GitHub (Oct 6, 2025): @itsrainingmani can probably help best here
Author
Owner

@itsrainingmani commented on GitHub (Oct 6, 2025):

Weird. Let me investigate this 🫡

@itsrainingmani commented on GitHub (Oct 6, 2025): Weird. Let me investigate this 🫡
Author
Owner

@merlinr68 commented on GitHub (Dec 9, 2025):

I had this same error and the solution (for me) was to remove an invalid 'cafile' setting in my ~/.npmrc file. May work for you if you've ever set the cafile=xxx and then deleted xxx or something.

@merlinr68 commented on GitHub (Dec 9, 2025): I had this same error and the solution (for me) was to remove an invalid 'cafile' setting in my ~/.npmrc file. May work for you if you've ever set the cafile=xxx and then deleted xxx or something.
Author
Owner

@Mattwmaster58 commented on GitHub (Dec 9, 2025):

@merlinr68 do you know how to trace whether it's invalid? Only thing I recall is settings NODE_EXTRA_CA_CERTS

@Mattwmaster58 commented on GitHub (Dec 9, 2025): @merlinr68 do you know how to trace whether it's invalid? Only thing I recall is settings NODE_EXTRA_CA_CERTS
Author
Owner

@Hona commented on GitHub (Jan 5, 2026):

for me the choco install launches but is not functional:

Image

bun install -g opencode-ai is the recommended method for windows!

@Hona commented on GitHub (Jan 5, 2026): for me the choco install launches but is not functional: <img width="1113" height="625" alt="Image" src="https://github.com/user-attachments/assets/ce7ad529-6de2-4069-9734-c91bb22fbea1" /> `bun install -g opencode-ai` is the recommended method for windows!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1971