SSH over Cloudflare tunnel always results in failed to connect to origin error="websocket: bad handshake" unless I use the web terminal

Hi, when I attempt to use SSH over a Cloudflare Tunnel I always get the error ERR failed to connect to origin error="websocket: bad handshake", I do have universal SSL set to flexible and websockets are enabled, there are no errors or messages at all in the origin cloudflared logs related to the connection. Any help would be appreciated.

1 Like

After having had a working configuration earlier in the day, without changing anything, I started getting the error ERR failed to connect to origin error="dial tcp [fd10:aec2:5dae::]:443: connect: network is unreachable". I re-set-up the whole thing, and now have this same bad handshake error. I don’t know what’s wrong either.

443 isn’t SSH.

I’m aware of that… I’m not attempting to connect over 443, or specifying that port anywhere. That error is output by the command cloudflared access ssh --hostname [my-cloudflare-access-configured-url].

had the same issue, the screenshot of the access panel config is misleading. Turn off bind http cookie setting.

1 Like

Thank you. Oh how much time was wasted here.

1 Like

Also, make sure your Cloudflare site of the relevant domain allows websockets in the Network settings.

Hi balupton, thanks for the tip. that’s very helpful. Could you please also share some pointers around how and where inside the cloudfare dashboard / zero trust dashboard do we change this setting to turn off http bind cookie?

1 Like

(post deleted by author)

Also wondering where to find this cookie setting. Been dealing with this issue for a couple of days too. Any hints would be great!

For where http bind cookie is

make sure you have brave shields off, as that could hide the toggle

1 Like