Allow an endpoint to read the alert data before closing the socket
authorMatt Caswell <matt@openssl.org>
Mon, 4 Sep 2017 10:20:27 +0000 (11:20 +0100)
committerMatt Caswell <matt@openssl.org>
Fri, 8 Sep 2017 12:10:57 +0000 (13:10 +0100)
commitbac6abe18d28373e0d2d0666c411020404197337
tree4ac6ccb2bef1998df00fe73fe4b86f22a7b259ff
parent180794c54e98ae467c4ebced3737e1ede03e320a
Allow an endpoint to read the alert data before closing the socket

If an alert gets sent and then we close the connection immediately with
data still in the input buffer then a TCP-RST gets sent. Some OSs
immediately abandon data in their input buffer if a TCP-RST is received -
meaning the alert data itself gets ditched. Sending a TCP-FIN before the
TCP-RST seems to avoid this.

This was causing test failures in MSYS2 builds.

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Ben Kaduk <kaduk@mit.edu>
(Merged from https://github.com/openssl/openssl/pull/4333)
apps/s_socket.c