Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary HTTP layer #118

Open
SeanBurford opened this issue Jan 23, 2024 · 3 comments
Open

Remove unnecessary HTTP layer #118

SeanBurford opened this issue Jan 23, 2024 · 3 comments

Comments

@SeanBurford
Copy link

The server currently uses an HTTP handler that expects a CONNECT method with a protocol of SSH3. ie. instead of GET / HTTP/1.0 it expects CONNECT / SSH3.

Current stack:

+------------------------------+
|          TLS / QUIC          |
+------------------------------+
|          HTTP Server         |
+-CONNECT SSH3-+-Other methods-|
| Shell Server | HTTP Server   |
+--------------+---------------+

That's easy to implement as a proof of concept, but the HTTP layer is unnecessary and makes it harder to multiplex a server (eg. as a web server and a shell server).

I propose that you could simplify the server and protocol by removing the HTTP layer. To do this, you would use these features of TLS:

Proposed stack:

+-------------------------------+
|             TLS / QUIC        |
+-NextProto SHH--+-NextProto H2-+
| Shell Server   | HTTP Server  |
+----------------+--------------+

This way the application protocol (Shell, HTTP, others) is made at the TLS termination point rather than at the web server layer, enabling easier integration with existing services.

If you've considered this already you may want to mention the trade offs in the docs.

@LPardue
Copy link

LPardue commented Jan 24, 2024

HTTP is what brings all the interesting things to this protocol.

There are several reasons why removing HTTP degrades the design:

  • Routing based on hostnames pushes information into the SNI, which is sent in cleartext
  • Routing based on ALPN uses information sent in cleartext
  • No free seemless support across TLS and QUIC. HTTP is an abstraction layer that handles describing how common semantics can map to specific versions and describes the standard transforms.
  • No free multiplexing. A specification would be required to invent multiplexing on top of TLS, or to describe precisely how QUIC streams are used, if it was later determined it would be required.
  • No free metadata. A specification would be required to invent additional forms of metadata if it was later determined it would be required.

As feature creep happens, before we know it any SSH-over-QUIC design might start to look quite close to HTTP. The danger is it takes ages to get there before we realise.

@DavidSchinazi
Copy link

+1 to @LPardue. We get quite a few benefits from HTTP/3 here. In terms of integration with existing software, the difficulty should be the same, the h3 stack can easily send the contents of the CONNECT stream (+ datagrams) to another piece of software over loopback - just like the TLS terminator would.

@costinm
Copy link

costinm commented Feb 29, 2024

I have no concerns with using HTTP for client-to-server - but CONNECT in particular is not well supported by existing infra ( proxies ), it should at least support POST as an option. Using SSH over HTTP/2 is pretty common ( with the double encryption, which allows end-to-end security ).

Adoption is very unlikely to happen if it requires major changes to http reverse proxies ( load balancers, etc) - if you have to run a custom server you can better run real ssh.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants