Skip to content

fix: load macOS system certificates and handle NO_PROXY blackhole for Bun runtime (closes #24470)#76640

Open
botbikamordehai2-sketch wants to merge 1 commit into
anthropics:mainfrom
botbikamordehai2-sketch:fix/issue-24470-1783764853
Open

fix: load macOS system certificates and handle NO_PROXY blackhole for Bun runtime (closes #24470)#76640
botbikamordehai2-sketch wants to merge 1 commit into
anthropics:mainfrom
botbikamordehai2-sketch:fix/issue-24470-1783764853

Conversation

@botbikamordehai2-sketch

Copy link
Copy Markdown

What

Claude Cowork fails to connect to the API with 'Self-signed certificate detected' error on macOS when using the Bun runtime introduced in v2.1.17+. The issue occurs because the Bun runtime's SSL context doesn't automatically load macOS system certificate store, and environment variables like NODE_EXTRA_CA_CERTS are not respected by the native binary.

Fix

  1. Add explicit SSL context configuration in _check_anthropic_connectivity() to load macOS default certificates using ssl.create_default_context() with explicit certificate loading
  2. Attempt to set NODE_EXTRA_CA_CERTS to a known macOS CA bundle path (e.g., /etc/ssl/cert.pem) for the Bun runtime
  3. Add NO_PROXY blackhole detection/protection where api.anthropic.com might be incorrectly listed in NO_PROXY causing connection timeouts

The fix ensures that when running under Bun on macOS, the SSL context properly loads system certificates so API connections work on clean home networks without requiring manual environment variable configuration.

Closes #24470

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Claude Cowork — "Self-signed certificate detected" on macOS with no proxy

1 participant