Opt-in TLS certificate verification for back-to-source requests
dfdaemon accepts any server certificate when it talks to the origin. That's fine for OCI images because containerd checks the digests. We use Dragonfly as a caching proxy for S3 objects, though, and nothing on that path checks the content. Anyone who can get between a node and the origin (or control DNS) can get a forged object cached and served to the whole cluster.
Where this happens:
The HTTP backend always builds its clients with NoVerifier: http.rs#L161-L167. The CA-pinned branch only runs if client_cert is set, but the back-to-source calls always pass None (task.rs#L212). So for cached requests it can't be configured at all. The proxy's direct path falls back to NoVerifier unless proxy.registryMirror.cert is set. When it is set, only that bundle is trusted, not the system roots. The comment there says "native roots", which isn't what the code does: proxy/mod.rs#L128-L142. The current behaviour is intentional (test), so I'm not asking to change the default.
Proposal: add an opt-in option and keep today's behaviour as the default.
backend:
tls:
verify: false # default, same as today
caCert: /path/ca.pem # optional, added to the system rootsWith verify: true, both the backend and the proxy's direct path check certificates against the system roots plus caCert. The Helm chart already passes client.config.backend and seedClient.config.backend through as-is, so the chart only needs the default added to values.yaml.
Source: dragonflyoss/dragonfly