]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: stream: don't retry SSL connections which fail the SNI name check
authorWilly Tarreau <w@1wt.eu>
Wed, 26 Jul 2017 18:13:37 +0000 (20:13 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 28 Jul 2017 10:06:05 +0000 (12:06 +0200)
commit46d5b0872ada05952574f070b751c793ab6af4fc
treee47dc32619a724c34b10ccb52cb24f1534ed5195
parent71d058c288b4d108ce9352da712fd33fa5a434c7
BUG/MEDIUM: stream: don't retry SSL connections which fail the SNI name check

Commits 2ab8867 ("MINOR: ssl: compare server certificate names to the
SNI on outgoing connections") and 96c7b8d ("BUG/MINOR: ssl: Fix check
against SNI during server certificate verification") made it possible
to check that the server's certificate matches the name presented in
the SNI field. While it solves a class of problems, it opens another
one which is that by failing such a connection, we'll retry it and put
more load on the server. It can be a real problem if a user can trigger
this issue, which is what will very often happen when the SNI is forwarded
from the client to the server.

This patch solves this by detecting that this very specific hostname
verification failed and that the hostname was provided using SNI, and
then it simply disables retries and the failure is immediate.

At the time of writing this patch, the previous patches were not backported
(yet), so no backport is needed for this one unless the aforementionned
patches are backported as well. This patch requires previous patches
"BUG/MINOR: ssl: make use of the name in SNI before verifyhost" and
"MINOR: ssl: add a new error code for wrong server certificates".
src/stream.c