Skip to content

Improvement: Claude Code and Codex refuse a Tale with a self-signed certificate, and nothing in the connect dialog or the guides says so #4973

Open

Description

@yannickmonney

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 init creates "a local-default .env (localhost, self-signed certificate, generated secrets)"; :114: tale dev launches 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 trust inside 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 client docs/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.md and docs/en/develop/mcp-endpoint.md.
  • The platform does not read the mode. Outside tests, TLS_MODE appears in services/platform only in an error message and a comment (backend/auth/auth.ts:527, :536); backend/env.ts does 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:30 covers reachability).
  • Windows and Linux.
  • How a person gets the CA's root certificate. services/proxy/README.md:52 points to the TLS and domains guide; it was not read for this issue.

Options (no preference stated)

  1. 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.
  2. A static note in the dialog, always shown or behind a disclosure, that points to that entry.
  3. A note shown only where the certificate is not public. This needs a deployment-level fact that the platform does not read today.
  4. A prompt from the dialog's own state: when no connection appears after some minutes, offer the troubleshooting entry. Not designed here.
  5. Nothing: a self-signed deployment is a development setup (hardening.md:38), and the browser warning is already the signal.

Questions

Related

#4958, #4962, #4933, #4926

Activity

  1. added
    priority: medium
    needs discussion
    improvement
    service: platform
    on Oct 13, 2026
  2. yannickmonney commented on Nov 14, 2026

    @yannickmonney
    ContributorAuthor

    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 for selfsigned (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

    • Supported or a development case only? Supported for local agents and tools once the program trusts the root CA. Not supported for hosted agents.
    • Which variables and error texts must the guide carry? Only what was seen against a real self-signed Tale, with Caddy's root and intermediate certificates:
      • Claude Code: 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: CODEX_CA_CERTIFICATE. If it isn't set, add doesn't start the sign-in and login fails with "OAuth metadata discovery failed … error sending request". SSL_CERT_FILE goes 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.
      • Other agents, SDKs and curl get a general line: use the client's own CA setting or the OS trust store, or use a public certificate.
    • Who verifies them? The docs change itself starts by running the new manual box MCP-F17 against a real tale dev stack 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:

    • prefers trust for one program over trust for the whole system, because Caddy's root can vouch for any hostname and its key sits in a Docker volume;
    • warns against a variable that replaces the default certificates, which would cut the agent off from its own model provider;
    • forbids turning certificate checks off.

    The section covers both the MCP tools and the model endpoints, because both fail the same way. The rejected options:

    • A note always shown in the dialog adds noise for deployments with a public certificate.
    • A note shown only for self-signed certificates needs a deployment fact the platform doesn't read, and could be wrong.
    • A timed prompt can't tell a TLS failure from someone who hasn't run the command yet.
    • Doing nothing leaves the default setup at a dead end.

    Implementation units

    1. Observe, then document (en/de/fr) + manual box (main, M):
      • Run Claude Code and Codex against a real self-signed tale dev stack on macOS and Linux, and record the run.
      • Add a page-level "Trust a private certificate" section (#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.
      • Add a row in the Connected agents "If it does not work" table.
      • Add one cross-link sentence each in the self-hosted troubleshooting page and the TLS and domains guide.
      • Add box MCP-F17 to the mcp manual suite, with its pin. It also checks that the agent still reaches its model provider.
      • No change to platform code.
    2. Other clients (main, S, after 1): in the test(platform): verify coding-agent sign-in end to end with Claude Code, Cursor, VS Code, Gemini CLI and claude.ai #4933 round, verify Cursor, VS Code, opencode, Gemini CLI and Windows, and add each verified setting in all three locales.

    Cross-issue amendments (decisions taken together with #4975):

  3. added
    agent-ready
    and removed
    needs discussion
    on Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readyimprovementpriority: mediumservice: platform

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions