mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-07 07:37:02 +02:00
MINOR: proto_reverse_connect: prevent transparent server for pre-connect
Prevent using transparent servers for pre-connect on startup by emitting a fatal error. This is used to ensure we never try to connect to a target with an unspecified destination address or port.
This commit is contained in:
parent
9b6812d781
commit
d3db96f11a
@ -186,12 +186,16 @@ int rev_bind_listener(struct listener *listener, char *errmsg, int errlen)
|
|||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO check que on utilise pas un serveur @reverse */
|
|
||||||
if (srv->flags & SRV_F_REVERSE) {
|
if (srv->flags & SRV_F_REVERSE) {
|
||||||
snprintf(errmsg, errlen, "Cannot use reverse server '%s/%s' as target to a reverse bind.", ist0(be_name), ist0(sv_name));
|
snprintf(errmsg, errlen, "Cannot use reverse server '%s/%s' as target to a reverse bind.", ist0(be_name), ist0(sv_name));
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (srv_is_transparent(srv)) {
|
||||||
|
snprintf(errmsg, errlen, "Cannot use transparent server '%s/%s' as target to a reverse bind.", ist0(be_name), ist0(sv_name));
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
|
||||||
/* Check that server uses HTTP/2 either with proto or ALPN. */
|
/* Check that server uses HTTP/2 either with proto or ALPN. */
|
||||||
if ((!srv->mux_proto || !isteqi(srv->mux_proto->token, ist("h2"))) &&
|
if ((!srv->mux_proto || !isteqi(srv->mux_proto->token, ist("h2"))) &&
|
||||||
(!srv->use_ssl || !isteqi(ist(srv->ssl_ctx.alpn_str), ist("\x02h2")))) {
|
(!srv->use_ssl || !isteqi(ist(srv->ssl_ctx.alpn_str), ist("\x02h2")))) {
|
||||||
|
Loading…
Reference in New Issue
Block a user