]> git.kaiwu.me - haproxy.git/commit
MEDIUM: tcpcheck: handle MySQL AuthSwitchRequest in mysql-check post-80 modes
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 17 Nov 2026 14:29:00 +0000 (15:29 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 23 Nov 2026 13:50:40 +0000 (14:50 +0100)
commit5bdfe2dc21c3440c4a28d35dcb7a177e55aa70ef
tree34f633ba853750625374d37a41dc797e48443116
parentc57a1d92aa48eb708e13f78fbb62aa8de837c992
MEDIUM: tcpcheck: handle MySQL AuthSwitchRequest in mysql-check post-80 modes

With the post-80 and post-80-sha2 modes, when the authentication
plugin of the check user differs from the announced one, the server
replies to the handshake response with an AuthSwitchRequest. The
check now answers with an empty password for the requested plugin,
then concludes on the authentication result: an OK packet marks the
server as UP, an ERR packet as DOWN, and a full authentication
request fails cleanly as it requires the password.

The AuthSwitchRequest packet is validated before being handled: a
packet with an empty payload or with a plugin name not terminated by
a NUL byte is reported as an invalid response. Otherwise the plugin
name would be searched outside the packet bounds.

To do so, the COM_QUIT command is no longer pipelined right after
the handshake response. It is now sent once the authentication
result is known, packed with the auth switch reply when there is
one, so the session is cleanly closed in every case and no
connection error is recorded on the server. The legacy pre-41 and
post-41 modes keep the pipelined COM_QUIT, they cannot receive an
auth switch request.
include/haproxy/tcpcheck.h
src/tcpcheck.c