]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: peers: use server as stream target
authorAurelien DARRAGON <adarragon@haproxy.com>
Thu, 30 Nov 2023 15:48:41 +0000 (16:48 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 21 Dec 2023 13:22:27 +0000 (14:22 +0100)
commit7293eb68ffee4e9e6fbdd857b7023a7f1b683ba0
tree728bc47f831baa5b57cb102a6e528947fb6d4130
parentc5cace310013529389b22a4307869caa79ec395f
MEDIUM: peers: use server as stream target

Historically, we used the internal peer proxy as stream target, because
then we only cared about initiating a basic tcp connection with the
endpoint, and relying on parent proxy settings was enough.

But later, we introduced the possibility to connect to an SSL peer by
taking server's SSL parameters into acount. This was done in commit
1055e687 ("MINOR: peers: Make outgoing connection to SSL/TLS peers work.")

However, the above commit introduced an ambiguity:

peer_session_target() function was introduced, and the function will
either return the peers proxy's object or the current server's object
depending if ssl is configured or not.

While this works fine to ensure proper SSL handling while being
conservative with historical behavior, this cause other server transport
related settings to only work when ssl settings are provided, which is
quite debatable.

Indeed, while we're there, why not always using the server's object as
a stream target, to ensure all transport related options are properly
handled? Moreover, the peers documentation tells this:

   ... "support for all "server" parameters found in 5.2 paragraph that
   are related to transport settings" ...

To remove the ambiguity and fully comply with the documentation, we make
peer_session_target() always return the server's object.
include/haproxy/peers.h