mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-21 05:41:26 +02:00
BUG/MINOR: server: Update healthcheck when server settings are changed via CLI
not all changes are concerned. But when the SSL is enabled or disabled for a server, the healthcheck xprt must be eventually be updated too. This happens when the healthcheck relies on the server settings. In the same spirit, when the healthcheck address and port are updated, we must fallback on the raw xprt if the SSL is not explicitly enabled for the healthcheck with a "check-ssl" parameter. This patch should be backported to all stable versions.
This commit is contained in:
parent
f8f94ffc9c
commit
a97bd0f505
@ -2779,6 +2779,9 @@ int srv_set_ssl(struct server *s, int use_ssl)
|
|||||||
}
|
}
|
||||||
s->xprt = xprt_get(XPRT_RAW);
|
s->xprt = xprt_get(XPRT_RAW);
|
||||||
}
|
}
|
||||||
|
/* Check if we must rely on the server XPRT for the health-check */
|
||||||
|
if (!s->check.port && !is_addr(&s->check.addr) && !s->check.use_ssl)
|
||||||
|
s->check.xprt = s->xprt;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -4601,6 +4604,10 @@ out:
|
|||||||
s->check.addr = sk;
|
s->check.addr = sk;
|
||||||
if (port)
|
if (port)
|
||||||
s->check.port = new_port;
|
s->check.port = new_port;
|
||||||
|
|
||||||
|
/* Fallback to raw XPRT for the health-check */
|
||||||
|
if (!s->check.use_ssl)
|
||||||
|
s->check.xprt = xprt_get(XPRT_RAW);
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user