kaichaosun / rlt

Localtunnel implementation in Rust, expose local API to the public.
MIT License
87 stars 11 forks source link

Not able to use https to establish tunnel #34

Open gdesmott opened 1 month ago

gdesmott commented 1 month ago

But establishing the tunnel using https with client --host https://$DOMAIN:3000 --subdomain badger --port 1848 does not work:

[2024-07-21T14:59:16Z INFO  localtunnel] Run localtunnel CLI!
[2024-07-21T14:59:16Z INFO  localtunnel_client] Request for assign domain: https://DOMAIN.org:3000/badger
[2024-07-21T14:59:16Z TRACE hyper_util::client::legacy::pool] checkout waiting for idle connection: ("https", DOMAIN:3000)
[2024-07-21T14:59:16Z DEBUG reqwest::connect] starting new connection: https://DOMAIN:3000/
[2024-07-21T14:59:16Z TRACE hyper_util::client::legacy::connect::http] Http::connect; scheme=Some("https"), host=Some("DOMAIN"), port=Some(Port(3000))
[2024-07-21T14:59:16Z DEBUG hyper_util::client::legacy::connect::dns] resolving host="DOMAIN"
[2024-07-21T14:59:16Z DEBUG hyper_util::client::legacy::connect::http] connecting to 5.39.84.21:3000
[2024-07-21T14:59:16Z TRACE mio::poll] registering event source with poller: token=Token(94103213250048), interests=READABLE | WRITABLE
[2024-07-21T14:59:16Z DEBUG hyper_util::client::legacy::connect::http] connected to 5.39.84.21:3000
[2024-07-21T14:59:16Z TRACE mio::poll] deregistering event source from poller
[2024-07-21T14:59:16Z TRACE hyper_util::client::legacy::pool] checkout dropped for ("https", DOMAIN:3000)
Error: error sending request for url (https://DOMAIN:3000/badger)

Caused by:
    0: client error (Connect)
    1: error:0A0000C6:SSL routines:tls_get_more_records:packet length too long:ssl/record/methods/tls_common.c:654:, error:0A000139:SSL routines::record layer failure:ssl/record/rec_layer_s3.c:645:
    2: error:0A0000C6:SSL routines:tls_get_more_records:packet length too long:ssl/record/methods/tls_common.c:654:, error:0A000139:SSL routines::record layer failure:ssl/record/rec_layer_s3.c:645:

It's unclear to me how https is supposed to be used here. Shouldn't we pass the keys to localtunnel server?

I guess this is supported somehow as the README example use https to establish the tunnel.