News for hackers. Stuff that matters.
Re:Show HN: Run SSH and HTTP(S) on the same port by dfox on Wednesday January 21, 2015 @10:20PM (#8927363)
For the case of ssh versus ssl the detection is trivial: first message for ssl comes from client but for ssh first message comes from server. So server simply waits for a while and assumes that client speaks ssh when it does not receive anything.

One can also match whatever is received in first message from client against known protocols (this approach makes it possible to for example run HTTP and HTTPS on same port as is done by IPP servers, particularly CUPS).

Re:Show HN: Run SSH and HTTP(S) on the same port by antoaravinth on Thursday January 22, 2015 @04:22AM (#8928279)
What do you mean by:

       first message for ssl comes from client but for ssh first message comes from server
Re:Show HN: Run SSH and HTTP(S) on the same port by userbinator on Thursday January 22, 2015 @09:04AM (#8929149)
With SSL/TLS, the client connects and sends a ClientHello message first, and then the server responds; with SSH, the server will send a version string upon connection (and expects the client to do the same). With plain HTTP, the client sends the request first. The server can detect which one of these cases it is.
Re:Show HN: Run SSH and HTTP(S) on the same port by antoaravinth on Thursday January 22, 2015 @11:07AM (#8929849)
I'm still being not clear of what you mean by:

>with SSH, the server will send a version string upon connection (and expects the client to do the same).

Say for example if I do:

   ssh some.machine.com
I'm (being the client ) call the ssh port ( server ) running on the some.machine.com, right? If thats the case, client is who starting the conversation right?

Correct me if I'm wrong.

Re:Show HN: Run SSH and HTTP(S) on the same port by nickcano on Thursday January 22, 2015 @06:54PM (#8932578)
Establishing a connection isn't considered 'sending a message'.
Re:Show HN: Run SSH and HTTP(S) on the same port by antoaravinth on Friday January 23, 2015 @12:14AM (#8933508)
Oh ok. Now I understood, thanks.