cloudflare / cloudflared

Cloudflare Tunnel client (formerly Argo Tunnel)
https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/install-and-setup/tunnel-guide
Apache License 2.0
8.79k stars 775 forks source link

🐛 tunnel is not handling subdomain properly #687

Closed eximius313 closed 2 years ago

eximius313 commented 2 years ago

Describe the bug When I create my tunnel, then:

To Reproduce Steps to reproduce the behavior:

  1. cloudflared tunnel route dns -f <UUID> foo.bar.mydomain.com (or use Cloudflare GUI)
  2. in .ssh/config
    Host foo.bar.mydomain.com
    ProxyCommand cloudflared access ssh --hostname %h
  3. ssh user@foo.bar.mydomain.com

Expected behavior Tunnel works

Environment and versions

Logs and errors

2022-07-05T20:29:54Z ERR failed to connect to origin error="websocket: bad handshake" originURL=https://foo.bar.mydomain.com
websocket: bad handshake
kex_exchange_identification: Connection closed by remote host
Connection closed by UNKNOWN port 65535
SayakMukhopadhyay commented 2 years ago

I believe this is due to second level subdomains not being supported by the free certificates offered by cloudflare.

sudarshan-reddy commented 2 years ago

@SayakMukhopadhyay is correct.

eximius313 commented 2 years ago

So how can I make bar.mydomain.com as "primary domain", so foo.bar.mydomain.com becomes "first level" instead of "second level"?

ninjadev64 commented 1 year ago

Oh, god. I've spent 3 hours trying to fix this, and just found this. ughhh