[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Gopher over TLS

On Sat, Mar 14, 2020 at 7:28 AM James Tomasino <tomasino@sdf.org> wrote:
gopher://cosmic.voyage serves TLS on port 7070. Previous discussions had
some people suggesting port 7443, 7000, or 71. A server that serves over
port 70 is likely to break things for non TLS clients.

A server that supports both TLS and plaintext can auto-detect the client's support.

Two methods:
A. Detect TLS: First byte of ClientHello is 0x16 -> process packet as TLS handshake (bytes 2-3 are the TLS version IIRC)
B. Detect plaintext: First TCP packet ends with `\r\n` -> process packet as plaintext Gopher request

Proof: I have implemented and deployed method B. Feel free to send both plaintext or TLS handshakes to commons.host:70 (multi-homed with GeoDNS but all nodes running the same code)

Reply to: