]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: checks: Only use ssl_sock_is_ssl() if compiled with SSL support
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 27 Apr 2020 10:06:55 +0000 (12:06 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 27 Apr 2020 10:06:56 +0000 (12:06 +0200)
ssl_sock_is_ssl() only exists if HAProxy is complied with SSL support.

No backport needed.

src/checks.c

index efc9ce2295397b6cbb37c86246388761b247936c..414c39e42181678d247dfd33773114f7ea8fef44 100644 (file)
@@ -2511,8 +2511,11 @@ static int tcpcheck_main(struct check *check)
                }
                else if (rule->action == TCPCHK_ACT_CONNECT) {
                        const char *msg = ((rule->connect.options & TCPCHK_OPT_IMPLICIT) ? NULL : "(tcp-check)");
-                       enum healthcheck_status status = ((conn && ssl_sock_is_ssl(conn)) ? HCHK_STATUS_L6OK : HCHK_STATUS_L4OK);
-
+                       enum healthcheck_status status = HCHK_STATUS_L4OK;
+#ifdef USE_OPENSSL
+                       if (conn && ssl_sock_is_ssl(conn))
+                               status = HCHK_STATUS_L6OK;
+#endif
                        set_server_check_status(check, status, msg);
                }
        }