tokio-rs / tls

A collection of Tokio based TLS libraries.

Home Page:https://tokio.rs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HTTP upgrade on the same port

daxpedda opened this issue · comments

I have this issue quiet often where I host a HTTPS server on a non-standard port, let's say 3000, but when I connect to it I get an error because I have to specify https:// otherwise it will attempt to use HTTP by default.

So I've been using a lot of different frameworks that use tokio-rustls and I am wondering where this could possibly be implemented. Is this in scope for tokio-rustls, or should this be implemented further up the chain?

I don't think TLS defines an application protocol agnostic way to upgrade from plain TCP to TLS, so I think this needs to happen at the application protocol level. In the case of HTTP, I think people usually just use a HTTP redirect for this? hyper-rustls focuses more on the client IIRC but might be a better place to put such an abstraction — though honestly I'm not sure this is common enough that it warrants inclusion in that crate.

In the case of HTTP, I think people usually just use a HTTP redirect for this?

That would have been the plan. I'm not aware of any other method at least.

hyper-rustls focuses more on the client IIRC but might be a better place to put such an abstraction — though honestly I'm not sure this is common enough that it warrants inclusion in that crate.

I guess I can always go higher up the chain 😆. Thanks anyway!