Skip to content

Trust a private CA for the hosts of API keys and MCP servers - #185

Merged
splitbrain merged 2 commits into
splitbrain:mainfrom
splitbrain-bot:upstream-ca
Nov 9, 2026
Merged

splitbrain merged 2 commits into
splitbrain:mainfrom
splitbrain-bot:upstream-ca

Conversation

@splitbrain-bot

@splitbrain-bot splitbrain-bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Closes #175.

Summary: An API key and an MCP server take an optional upstream CA. The egress proxy trusts it, in addition to the public CAs, for the hosts of the entry, so a credential works for a host with a certificate from a private CA, e.g., a Kubernetes API server or an MCP server with its own CA.

Changes:

  • The orchestrator stores one CA for each user and host pattern in the new upstream_cas table. All API keys and MCP servers of a user that name the same host pattern share the CA.
  • A save sets the CA of all hosts of the entry to the content of the field, and an empty field removes it. The form shows the CA when all hosts of the key have the same one, and a notice when the hosts have different CAs.
  • The orchestrator removes a CA together with the last API key or MCP server of the user that names its host.
  • The egress policy gives each box the CAs of its owner. The front door hands a CONNECT to a host with a CA of the box to the interception engine, also when no credential belongs to the host. The engine finds the box of a request from the port of its connection from the front door, and it has one passthrough rule for each CA. The CA of one user thus applies only to the requests from the boxes of that user.
  • The OAuth login of an MCP server trusts the CA for the host of the server.
  • The docs describe the upstream CA in credentials.md, agent-sets.md, egress.md and rest.md. rest.md gets a section for the API key routes.

Tests: new tests for the store, the API keys, the MCP servers, the policy, the front door and the engine. The engine tests use a stand-in origin with a private CA, with HTTP/1.1, HTTP/2 and a websocket upgrade.

The egress proxy checked the certificate of an intercepted host against the
public CAs only. A credential for a host with a certificate from a private CA,
such as a Kubernetes API server or an MCP server with its own CA, failed with a
TLS error.

An API key and an MCP server now take an optional upstream CA. The
orchestrator stores one CA for each user and host pattern, so all API keys and
MCP servers of a user for a host share it. It removes a CA when no API key and
no MCP server of the user names the host.

The proxy trusts the CA in addition to the public CAs, and only in requests
from the boxes of the user. It intercepts a host with an upstream CA also when
no credential belongs to the host, so an MCP server without authentication can
use the CA too. The OAuth login of an MCP server trusts the CA for the host of
the server.
The docs described the proxy as intercepting only credential hosts and had no
word on private certificate authorities. They now describe the upstream CA of
an API key and an MCP server, the rule that one host has one upstream CA for
each user, the interception of hosts with an upstream CA, and the API fields.
The API key routes had no section in the REST document and get one.
@splitbrain
splitbrain merged commit 8b946a5 into splitbrain:main Nov 9, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

API keys: optional upstream CA for hosts with a private certificate authority

2 participants