You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Self-hosted HTTPS server with a local CA is shown as unreachable #1290
The app can't connect to a self-hosted OpenCode server over HTTPS when the certificate is signed by a local CA that macOS trusts. The server shows as unreachable.
What happens
Browser and curl reach the server on the same machine. curl gets 401 without the token, and the expected JSON with it.
The app shows the server as unreachable. A pairing link for the same HTTPS URL fails too.
There is no log for the TLS error; the health check only says unreachable.
Why
The app only trusts the public root certificates it ships with, not the system trust store. The TLS handshake fails with invalid peer certificate: UnknownIssuer. The same HTTP client with the system verifier gets the normal 401/200 answers.
The event stream, pairing link redemption and terminal WebSocket use the same trust, so they fail too.
How to reproduce
Put an OpenCode server behind HTTPS with a certificate from a local CA.
Trust the CA in the system store; browser and curl work.
Add the server in the app, or open a pairing link.
Added the net-trust crate so every HTTPS request (server health probes, API requests, SSE event streams, pairing link redemption, plugins, and updater) and every wss:// WebSocket (terminal, MCP, and browser RPC tunnel) verifies certificates against both the compiled-in Mozilla roots (webpki-root-certs) and the operating system certificate store (rustls-native-certs, including macOS Keychain trust settings).
Added the scripts/guardrails/net-trust.mjs guardrail so new HTTP or WebSocket call sites cannot bypass the shared trust store.
Verification
Verified: All 7 PR CI checks passed (guardrails, plan, build-macos, build-windows x64/arm64, build-linux x64/arm64), local pwsh scripts/guardrails.ps1 passed (10/10 including net-trust) on the merged dev tree, and PR fix(net): every HTTPS request and wss socket trusts the system certificate store's roots #1124 tested custom local CA trust on Linux and public/untrusted cert verification on Windows.
Not verified on hardware yet: Live macOS Keychain local-CA runtime test and live wss:// handshake with a local CA.
Please reopen if a self-hosted HTTPS server with a macOS-trusted local CA still fails to connect on the next dev build.
Activity
Hona commentedon Nov 27, 2026
Fixed in #1124 (merged to
devin3ba13ebf).What changed
net-trustcrate so every HTTPS request (server health probes, API requests, SSE event streams, pairing link redemption, plugins, and updater) and everywss://WebSocket (terminal, MCP, and browser RPC tunnel) verifies certificates against both the compiled-in Mozilla roots (webpki-root-certs) and the operating system certificate store (rustls-native-certs, including macOS Keychain trust settings).scripts/guardrails/net-trust.mjsguardrail so new HTTP or WebSocket call sites cannot bypass the shared trust store.Verification
guardrails,plan,build-macos,build-windowsx64/arm64,build-linuxx64/arm64), localpwsh scripts/guardrails.ps1passed (10/10 includingnet-trust) on the mergeddevtree, and PR fix(net): every HTTPS request and wss socket trusts the system certificate store's roots #1124 tested custom local CA trust on Linux and public/untrusted cert verification on Windows.wss://handshake with a local CA.Please reopen if a self-hosted HTTPS server with a macOS-trusted local CA still fails to connect on the next dev build.