[BUG] preview_start embedded browser rejects locally-trusted mkcert certificates
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
preview_start cannot load HTTPS dev servers that use locally-trusted certificates (e.g. from mkcert). Both the health check and the embedded Chromium browser reject the certificates, even though they are trusted by the host system's certificate store.
This forces workarounds like making the dev server serve HTTP instead, which breaks the ability to use the same server from a regular browser for OAuth flows that require HTTPS.
Steps to Reproduce
- Generate localhost certs with
mkcert localhostand install the CA withmkcert -install - Configure a dev server (e.g. Vite) to use these certs for HTTPS
- Set up
.claude/launch.jsonwith"url": "https://localhost:5100" - Run
preview_start
Expected Behavior
Preview browser trusts locally-installed CAs, page loads normally.
Actual Behavior
Two issues:
- Health check rejects the cert — "Awaiting server..." forever (likely Node.js-based, doesn't use system trust store)
- Embedded Chromium rejects the cert — navigating via
preview_evalwithwindow.location.replace('https://...')lands onchrome-error://chromewebdata/
Suggested Fix
- Health check: respect
NODE_EXTRA_CA_CERTSor read system trust store - Embedded Chromium: launch with
--ignore-certificate-errorsfor localhost, or import system CA roots
Workaround
Configure the dev server to serve HTTP when launched from preview_start, but this means HTTPS-dependent flows (like OAuth) can't be tested in a regular browser on the same server.
Environment
- OS: macOS 15.4
- Claude Code: latest (Claude Desktop)
- Cert tool: mkcert v1.4.4
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗