Import RKE cluster into Rancher

Hi,
I have problem importing a kubernetes cluster created by RKE.
It’s not certificate problem, the agent only says bad handshake.

time=“2018-11-20T07:43:05Z” level=info msg=“Connecting to wss://rancher.johed.se:8643/v3/connect with token 6tzv47gb8mqlgkxn5s2zgd7psphvmgpldsz24j85r77h47r5lc8qdn”
time=“2018-11-20T07:43:05Z” level=info msg=“Connecting to proxy” url=“wss://rancher.johed.se:8643/v3/connect”
time=“2018-11-20T07:43:05Z” level=error msg=“Failed to connect to proxy” error=“websocket: bad handshake”
time=“2018-11-20T07:43:05Z” level=error msg=“Failed to connect to proxy” error=“websocket: bad handshake”

Any ideas how to debug or fix?

rancher v2.1.1
rke v0.1.11

Regards,
Stefan

Do you have a load balancer in front of the Rancher cluster like ALB, ELB? I think this error means that the load balancer does not support websockets, which Rancher uses.

No, Rancher runs in a docker container, accessed directly to the host.

I fixed the problem.
Added the Kubernetes cert, /etc/kubernetes/ssl/kube-ca.pem to Rachers cacerts.pem file

Started rancher like this.
docker run -d -v /tmp/cacerts.pem:/etc/rancher/ssl/cacerts.pem -v /var/lib/rancher/:/var/lib/rancher/ rancher/rancher:v2.1.1

my cluster is behind NLB but aws states that they support websockets.