Sandbox TLS verification fails for gh CLI despite github.com in allowedHosts
Resolved 💬 2 comments Opened Apr 9, 2026 by emeentag Closed May 23, 2026
Bug
gh CLI commands fail with a TLS certificate verification error when running inside the Claude Code sandbox, even though github.com is listed in the sandbox's allowedHosts.
Error
Post "https://api.github.com/graphql": tls: failed to verify certificate: x509: OSStatus -26276
Reproduction
- Ensure
github.comis in sandboxallowedHosts(it is by default) - Run any
ghcommand (e.g.gh repo view owner/repo --json name) - Command fails with the TLS error above
- Same command succeeds with
dangerouslyDisableSandbox: true
Expected behavior
Commands targeting allowed hosts should work without TLS errors. The sandbox network proxy should either pass through TLS directly for allowed hosts or present a certificate trusted by the system.
Environment
- macOS (Darwin 25.3.0)
- Claude Code CLI
ghCLI authenticated and working outside sandbox
Workaround
Adding gh to sandbox.excludedCommands in settings, or enabling unsandboxed fallback mode.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗