francoismichel / ssh3

SSH3: faster and rich secure shell using HTTP/3, checkout our article here: https://arxiv.org/abs/2312.08396 and our Internet-Draft: https://datatracker.ietf.org/doc/draft-michel-ssh3/
https://arxiv.org/abs/2312.08396
Apache License 2.0
3.27k stars 82 forks source link

Remove unnecessary HTTP layer #118

Open SeanBurford opened 8 months ago

SeanBurford commented 8 months ago

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 commented 8 months ago

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

There are several reasons why removing HTTP degrades the design:

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 commented 8 months ago

+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 commented 7 months ago

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.