Repository navigation
Description
Summary
The bundled proxy's default is a self-signed certificate (TLS_MODE=selfsigned), and tale init and tale dev set up exactly that. A person opens Tale in a browser by accepting the warning, then runs the connect dialog's commands in a terminal. Claude Code and Codex check certificates against their own trust sources, not the browser's. Run against a stand-in with an untrusted certificate, neither connected, and neither said what to do about it. Neither the dialog nor the guides mention certificates. This issue records what was observed and what the repository says. It states no preference.
What the repository says (main at 8a0732529c)
- The default.
compose.yml:574-575("TLS_MODE=selfsigned - Self-signed certs (default, for development)"),compose.dev.yml:49(TLS_MODE: ${TLS_MODE:-selfsigned}),services/proxy/Caddyfile:8("selfsigned" (default): Self-signed certificates via Caddy's internal CA).docs/en/self-hosted/install/cli-install.md:109:tale initcreates "a local-default.env(localhost, self-signed certificate, generated secrets)";:114:tale devlaunches with a self-signed certificate. - What the repository tells people about trust.
services/proxy/README.md:49-54("install the CA certificate in each client device's trust store …caddy trustinside the container does not install trust on the host"),docs/en/self-hosted/operate/observability/troubleshooting.md:14,docs/en/self-hosted/operate/security/hardening.md:38("Use a trusted certificate for the address people actually open."), and for another clientdocs/en/platform/admin/sandbox-devices.md:112("A deployment that uses a self-signed certificate cannot take devices."). - What the dialog and the guides say about certificates: nothing. Searched for "certificat", "TLS", "self-signed" and "NODE_EXTRA_CA_CERTS" in
services/platform/messages/en/codingAgent.yml,agentConnections.yml,docs/en/platform/admin/connected-agents.md,docs/en/develop/use-tale-from-your-editor.mdanddocs/en/develop/mcp-endpoint.md. - The platform does not read the mode. Outside tests,
TLS_MODEappears inservices/platformonly in an error message and a comment (backend/auth/auth.ts:527,:536);backend/env.tsdoes not read it. The proxy reads it. Whether the platform containers' environment holds it was not examined. - How the commands are built. From the endpoint's address alone, with no key (
services/platform/app/features/coding-agent/lib/setup-steps.ts:1-11).
What was observed
2026-10-13, macOS (arm64). Tale itself was not served over a self-signed certificate; a stand-in was. It is an HTTPS server that answers like the MCP endpoint does without a token: 401 with WWW-Authenticate: Bearer resource_metadata="https://localhost:3555/.well-known/oauth-protected-resource/api/v1/mcp", on a leaf certificate for localhost signed by a throwaway CA (one CA level; Caddy's internal CA presents a longer chain, which was not examined).
| Client | Certificate not trusted | With the CA trusted |
|---|---|---|
Claude Code 2.1.296: claude mcp add --transport http x <url>, then claude mcp list |
✘ Failed to connect — UNABLE_TO_VERIFY_LEAF_SIGNATURE: unable to verify the first certificate. With one self-signed certificate instead of a CA-signed leaf: DEPTH_ZERO_SELF_SIGNED_CERT: self signed certificate. |
With NODE_EXTRA_CA_CERTS=<CA file> the handshake passes: the stand-in saw POST /api/v1/mcp, the discovery documents and POST /register. It then ended at "Dynamic Client Registration rejected (HTTP 404)", because the stand-in has no sign-in server. |
Codex 0.162.0: codex mcp add x --url <url> |
Prints "Added global MCP server 'x'. MCP server may or may not require login. Run codex mcp login x to login." It did not detect OAuth and did not start the sign-in that it starts against a trusted Tale (#4962). codex mcp login x --no-browser then fails: "Error: Metadata error: OAuth metadata discovery failed for https://localhost:3555/api/v1/mcp Caused by: HTTP request failed: http/request failed: error sending request for url (…)". No request reached the stand-in. |
With CODEX_CA_CERTIFICATE=<CA file>, or with SSL_CERT_FILE=<CA file>, the login went past TLS: about a dozen requests reached the stand-in, and it failed at the missing registration endpoint. With one self-signed certificate used as the trust anchor, neither variable changed the error. |
Claude Code's message names the problem by its Node error code. Codex's says only that a request could not be sent and never mentions a certificate.
Reproduction: a Bun server with tls: { cert, key } for a leaf signed by a throwaway CA (SAN localhost, CA:FALSE), answering /api/v1/mcp as above; then the commands in the table, with and without the variable.
What was not observed
- Caddy's actual internal CA chain and a real Tale behind it.
- What the dialog shows in that case. It should stay on "Waiting for your agent to sign in…" because no connection is ever made; that follows from how the watcher works and was not run against a self-signed deployment.
- Cursor, VS Code, opencode and Gemini CLI. A cloud agent such as claude.ai cannot reach a private host at all (
hardening.md:30covers reachability). - Windows and Linux.
- How a person gets the CA's root certificate.
services/proxy/README.md:52points to the TLS and domains guide; it was not read for this issue.
Options (no preference stated)
- Documentation only: a troubleshooting entry in the Connected agents guide and the editor guide that names what each client prints and the variable to set.
- A static note in the dialog, always shown or behind a disclosure, that points to that entry.
- A note shown only where the certificate is not public. This needs a deployment-level fact that the platform does not read today.
- A prompt from the dialog's own state: when no connection appears after some minutes, offer the troubleshooting entry. Not designed here.
- Nothing: a self-signed deployment is a development setup (
hardening.md:38), and the browser warning is already the signal.
Questions
- Is a self-signed deployment a supported place to connect a coding agent, or a development case only?
- If supported, which clients' variables and error texts must the guide carry, and who verifies them (the round in test(platform): verify coding-agent sign-in end to end with Claude Code, Cursor, VS Code, Gemini CLI and claude.ai #4933 could)?
Activity
yannickmonney commentedon Nov 14, 2026
Decision
Rule: A Tale deployment with a self-signed certificate (
TLS_MODE=selfsigned, Caddy's internal CA) is a supported place to connect a coding agent or tool that runs on a person's own machine, on one condition: the program trusts the deployment's root CA, preferably through a setting for that program alone. This applies the rule the TLS and domains guide already sets forselfsigned(a private environment whose clients trust your CA). Hosted agents (claude.ai, Claude Desktop, mobile) can't use a private deployment. A self-signed setup is still not a production recommendation.Answers
NODE_EXTRA_CA_CERTS, with the error it really prints there. The codes seen against the earlier test server don't match Caddy's certificate chain, so they aren't published unless they show up again.CODEX_CA_CERTIFICATE. If it isn't set,adddoesn't start the sign-in andloginfails with "OAuth metadata discovery failed … error sending request".SSL_CERT_FILEgoes into the guide only if it adds to Codex's trusted certificates rather than replacing them. Otherwise the guide mentions it only pointed at a full bundle.MCP-F17against a realtale devstack on macOS and Linux. The test(platform): verify coding-agent sign-in end to end with Claude Code, Cursor, VS Code, Gemini CLI and claude.ai #4933 round adds the other clients and Windows.Rationale: The failure happens inside the client before any request reaches Tale, so documentation is the right layer, and the dialog's "Setup guide" link already leads there. The guide:
The section covers both the MCP tools and the model endpoints, because both fail the same way. The rejected options:
Implementation units
tale devstack on macOS and Linux, and record the run.#private-certificate) to the editor guide, quoting only what the run showed. Link it from the coding-agent section and from the model-endpoints troubleshooting.MCP-F17to the mcp manual suite, with its pin. It also checks that the agent still reaches its model provider.Cross-issue amendments (decisions taken together with #4975):