With Docker 18.03, the following:
docker swarm ca --rotate --ca-cert /path/to/ca.pem --external-ca protocol=cfssl,url=https://cfsslserver.example/api/v1/cfssl/sign
fails with:
Error response from daemon: rpc error: code = InvalidArgument desc = there must be at least one valid, reachable external CA corresponding to the desired CA certificate
Running dockerd in debug mode shows that the underlying API call to https://docs.docker.com/engine/api/v1.37/#operation/SwarmUpdate has an empty ExternalCAs.CACert, and instead the --ca-cert param. populates SigningCACert.
Calling the API directly with the CFSSL CA in the CACert field results in successful cert. rotation.
Is there an undocumented param. that maps to CACert, or is the CLI just completely broken for this purpose?
Some other issues:
- Omitting the
--ca-cert param. entirely results in the external CA param. being completely ignored, and the CA rotating to another internal CA (also bad/unexpected behaviour)
- It's not clear from the documentation at https://docs.docker.com/engine/reference/commandline/swarm_ca/ that the endpoint should be the full path to CFSSL's /sign
- CFSSL is not mentioned anywhere on the above doc. page, nor is the KV format of the --external-ca param.
- Specifying a cert. + key (as an externally generated intermediate CA pair signed by CFSSL) "works" in that the CA seems to rotate and is listed in
docker info as having CFSSL as an external CA (and the swarm functions), but then on next restart of the swarm nodes, the nodes can't communicate with each other to re-establish the swarm, throwing a generic "bad TLS" error.
With Docker 18.03, the following:
docker swarm ca --rotate --ca-cert /path/to/ca.pem --external-ca protocol=cfssl,url=https://cfsslserver.example/api/v1/cfssl/signfails with:
Error response from daemon: rpc error: code = InvalidArgument desc = there must be at least one valid, reachable external CA corresponding to the desired CA certificateRunning dockerd in debug mode shows that the underlying API call to https://docs.docker.com/engine/api/v1.37/#operation/SwarmUpdate has an empty
ExternalCAs.CACert, and instead the--ca-certparam. populatesSigningCACert.Calling the API directly with the CFSSL CA in the CACert field results in successful cert. rotation.
Is there an undocumented param. that maps to CACert, or is the CLI just completely broken for this purpose?
Some other issues:
--ca-certparam. entirely results in the external CA param. being completely ignored, and the CA rotating to another internal CA (also bad/unexpected behaviour)docker infoas having CFSSL as an external CA (and the swarm functions), but then on next restart of the swarm nodes, the nodes can't communicate with each other to re-establish the swarm, throwing a generic "bad TLS" error.