]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: ssl: Set connection error code in case of SSL read or write fatal failure
authorRemi Tricot-Le Breton <rlebreton@haproxy.com>
Wed, 29 Sep 2021 16:56:51 +0000 (18:56 +0200)
committerWilliam Lallemand <wlallemand@haproxy.org>
Thu, 30 Sep 2021 09:04:35 +0000 (11:04 +0200)
commit61944f7a73b1762771b15c95d3e74780d0cdc4cd
tree99174ec4ea9797cf583086a394b021ff98bafabd
parentdbee2e57fd7d78bc8aff2ed18357af9921e31e03
MINOR: ssl: Set connection error code in case of SSL read or write fatal failure

In case of a connection error happening after the SSL handshake is
completed, the error code stored in the connection structure would not
always be set, hence having some connection failures being described as
successful in the fc_conn_err or bc_conn_err sample fetches.
The most common case in which it could happen is when the SSL server
rejects the client's certificate. The SSL_do_handshake call on the
client side would be sucessful because the client effectively sent its
client hello and certificate information to the server, but the next
call to SSL_read on the client side would raise an SSL_ERROR_SSL code
(through the SSL_get_error function) which is decribed in OpenSSL
documentation as a non-recoverable and fatal SSL error.
This patch ensures that in such a case, the connection's error code is
set to a special CO_ERR_SSL_FATAL value.
doc/configuration.txt
include/haproxy/connection-t.h
include/haproxy/connection.h
src/ssl_sock.c