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.

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.

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