MINOR: ssl: improve socket behaviour upon handshake abort.
authorWilly Tarreau <w@1wt.eu>
Fri, 19 Oct 2012 18:52:18 +0000 (20:52 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 19 Oct 2012 18:56:59 +0000 (20:56 +0200)
commit566dc5545bb4c55fdfd883ffa3bdcd6485f6f80e
treee8dc47596a9d2dd2d0015b2a6f33436c65ca9a26
parent2e845be2492852b69b581c2fd11147633087ddab
MINOR: ssl: improve socket behaviour upon handshake abort.

While checking haproxy's SSL stack with www.ssllabs.com, it appeared that
immediately closing upon a failed handshake caused a TCP reset to be emitted.
This is because OpenSSL does not consume pending data in the socket buffers.
One side effect is that if the reset packet is lost, the client might not get
it. So now when a handshake fails, we try to clean the socket buffers before
closing, resulting in a clean FIN instead of an RST.
src/ssl_sock.c