Commit Graph
1 Commits
Author SHA1 Message Date
Graeme Smecher d7b0d4bedb Drain the socket before closing a TLS connection (#2673)
Server::process_and_close_socket() half-closes the socket and drains what
the peer is still sending before the final close (#2534), so that a close
with unread data, or with bytes still in flight, is not answered with a
RST. A RST can make the peer's stack discard a response it has received
but not yet read, as Windows does.

SSLServer::process_and_close_socket() still closed outright. After a
completed handshake, shut down TLS as before (sending close_notify when
the exchange completed) and then drain the same way. A failed handshake
closes outright as before.

Fix #2672
2026-11-16 23:53:56 -05:00