BUG/MEDIUM: checks: Don't try to set ALPN if connection failed.

If we failed to connect, don't attempt to set the ALPN, as we don't have
a SSL context, anyway.

This should be backported to 1.9.
This commit is contained in:
Olivier Houchard 2019-01-29 16:37:52 +01:00 committed by Willy Tarreau
parent 26da323cb9
commit a48437bb5e

View File

@ -1641,11 +1641,13 @@ static int connect_conn_chk(struct task *t)
#ifdef USE_OPENSSL
if (s->check.sni)
ssl_sock_set_servername(conn, s->check.sni);
if (s->check.alpn_str)
ssl_sock_set_alpn(conn, (unsigned char *)s->check.alpn_str,
s->check.alpn_len);
if (ret == SF_ERR_NONE) {
if (s->check.sni)
ssl_sock_set_servername(conn, s->check.sni);
if (s->check.alpn_str)
ssl_sock_set_alpn(conn, (unsigned char *)s->check.alpn_str,
s->check.alpn_len);
}
#endif
if (s->check.send_proxy && !(check->state & CHK_ST_AGENT)) {
conn->send_proxy_ofs = 1;