Add some help for TLS clients, in case we only serve plaintext. - geomyidae - A small C-based gopherd. HTML git clone git://bitreich.org/geomyidae/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/geomyidae/ DIR Log DIR Files DIR Refs DIR Tags DIR README DIR LICENSE --- DIR commit d7ed711f28717554c22cdd8efc620524268760a0 DIR parent 05ca154290d4cde25b629122f0ba36d43442ed62 HTML Author: Christoph Lohmann <20h@r-36.net> Date: Sun, 7 Jun 2020 22:39:58 +0200 Add some help for TLS clients, in case we only serve plaintext. Diffstat: M main.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) --- DIR diff --git a/main.c b/main.c @@ -777,7 +777,23 @@ main(int argc, char *argv[]) if (tls_handshake(tlsclientctx) < 0) return 1; } -#endif /* ENABLE_TLS */ +#else /* ENABLE_TLS */ + /* + * Some TLS request. Help them determine we only + * serve plaintext. + */ + if (byte0 == 0x16) { + if (loglvl & CONN) { + logentry(clienth, clientp, "-", + "disconnected"); + } + + shutdown(sock, SHUT_RDWR); + close(sock); + + return 1; + } +#endif maxrecv = sizeof(recvb) - 1; do {