Tunnel RDP connection: Error="websocket : bad handshake"

Hi, we’re getting this error when trying to connect to RDP through the tunnel:
connection: Error=“websocket : bad handshake”

The windows computer we want to connect to seems to have a tunnel properly set up.

CF access gave returned:

A token has been returned to the machine that initiated the request. Feel free to close this browser window.
Application Domain: aaaa.bbbbbbb.nl

Then run:
Run the following command to create a connection from the device to Cloudflare. Any available port can be specified, but in this example we will use 3389 as it is the default port for RDP connections.

Then open RDP screen and connect to localhost:3389

The get:
ERR failed to connect to origin error=“websocket: bad handshake” originURL=

Websockets are enabled fro the zone.
SSL is set to Full
Normal RDP connection to the computer works.

Any ideas?!

Have you checked if the “cloudflared tunnel” process logs anything when you attempt to access your RDP server through it?

Gateway logs are still empty.
What i can see in the access logs is:

“app_name”: “XXX XXX Server”,
“user_email”: “[email protected]”,
“user_id”: “XXXX”,
“ip_address”: “XXXXX”,
“app_uid”: “XXXXXXX”,
“app_domain”: “server.XXXXXXX.nl”,
“app_type”: “self_hosted”,
“action”: “login”,
“connection”: “google-apps”,
“allowed”: true,
“created_at”: “2022-06-30T07:49:36Z”,
“ray_id”: “72354e586d4eb8ea”,
“country”: “nl”

That’s not what I was referring to.

You started a “cloudflared tunnel” process in your server. That outputs logs. Those are the one you should look for when you have this error.

Ok. Any idea where I can find them on a Windows comp?

You can configure your Tunnel process to output to a file of yoru choice with this flag: https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/configuration/arguments/#logfile

If you run your Tunnel as a Windows service, you can see more info in https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/run-tunnel/as-a-service/windows/