Watch
0
0
Fork
You've already forked hyperhive
0

swarmctl: on a controller host, trust the swarm's root without SWARMCTL_CA_FILE

`swarmctl login` (and any `--swarm` verb) on a controller host failed TLS
with `UnknownIssuer` against the swarm's own gateway: its leaf chains to
the store's `pki` root, which no system store holds, and the only way
through was `--ca-file`/`SWARMCTL_CA_FILE` by hand.

The host's swarmctl wrapper now sets `SSL_CERT_FILE` to the bundle the
swarm-controller daemon already trusts (`/run/swarm-controller-ca/
trust-bundle.pem`: system CAs plus the swarm's root), when the gateway is
self-signed. swarmctl's reqwest/rustls resolves roots the same way the
daemon's does, so this is the path the daemon uses to reach the same
gateway. `--set` rather than a default, since a nix shell exports its own
`SSL_CERT_FILE`.

Pointing `SWARMCTL_CA_FILE` at the bundle instead would not work (#5243):
`--ca-file` adds each certificate as a root and fails the whole client on
one it can't parse.

Hosts without the controller (an operator laptop) still need `--ca-file`.

Refs #5239
Fixes #5243
This commit is contained in:
atlas 2026-10-14 10:18:40 +02:00 • committed by mara
commit 7d24feaf25
3 changed files with 20 additions and 2 deletions

View file

@ -189,5 +189,8 @@ refuses it. When it can't be refreshed, any verb says to run `swarmctl login`
again. To log out, delete the file.
A swarm whose gateway serves a certificate from the swarm's own CA needs
that CA: `--ca-file` or `SWARMCTL_CA_FILE`. The `user` verbs edit the local
that CA. On a controller host the swarm-controller module's wrapper sets
`SSL_CERT_FILE` to the bundle the daemon itself trusts (the system CAs plus
the swarm's root), so nothing needs setting there. Elsewhere, pass the CA
with `--ca-file` or `SWARMCTL_CA_FILE`. The `user` verbs edit the local
users file and have no remote form.