Bad certificate error when joining swarm

I am following the documentation

but during the Initialize the swarm and add nodes section, I get an cryptic error:

"Error response from daemon: rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = transport: authentication handshake failed: remote error: tls: bad certificate"

Below is the full command line sequence:

> docker-machine ls
NAME    ACTIVE   DRIVER   STATE     URL   SWARM   DOCKER    ERRORS
myvm1   -        hyperv   Running   tcp://10.0.0.2:2376  v18.06.1-ce
myvm2   -        hyperv   Running   tcp://10.0.0.3:2376  v18.06.1-ce
> docker-machine ssh myvm1 "docker swarm init --advertise-addr 10.0.0.2:2376"
Swarm initialized: current node (tjwygiuyihwztrgqumhrbhupw) is now a manager.

To add a worker to this swarm, run the following command:

    docker swarm join --token SWMTKN-1-2y6it3299chbm46do2jbk1yj9csmv021zlcwi2yhxo2ep1i2jg-2grqwx68c6xe4tpfpk9f3r2x6 10.0.0.2:2376

To add a manager to this swarm, run 'docker swarm join-token manager' and follow the instructions.
> docker-machine ssh myvm2 "docker swarm join --token SWMTKN-1-2y6it3299chbm46do2jbk1yj9csmv021zlcwi2yhxo2ep1i2jg-2grqwx68c6xe4tpfpk9f3r2x6 10.0.0.2:2376"

Error response from daemon: rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = "transport: authentication handshake failed: remote error: tls: bad certificate"
exit status 1

Iā€™ve seen this error before. I donā€™t think it comes from ā€˜docker swarm joinā€™. I think the error comes from connecting to the docker machine myvm2. Does this have the same error?: docker-machine ssh myvm2

I have the same error exactly and I have seen this query posed in a few places with no reply. Iā€™m running the latest version of Docker for Mac, the latest VMBox download. Iā€™d love to resolve this if anyone can help please?

I tried killing and RM the VMs and recreating them from scratch, but get the same problem each time.

check out this forum post

Had the same problem, it started working when I changed the advertise/listen port to 2377

3 Likes

The instructions state:

"$ docker-machine ssh myvm2 ā€œdocker swarm join
ā€“token ā€˜tokenā€™
ā€˜ipā€™:2377ā€

This node joined a swarm as a worker."

note that the port was updated to 2377, you have it at 2376!

2 Likes

Thanks. Worked like a charm.

It works when I correct 2376 to 2377.
Thanks a lot.

thanks :slight_smile:

Thanks, it worked correctly