From 813893bfce99616a9ed7ccd39f5d5a306518f871 Mon Sep 17 00:00:00 2001 From: Brian Fox Date: Fri, 6 Sep 2019 16:03:35 +0200 Subject: [PATCH] Log error on SSL handshake failure - don't fail silently --- lib/resty/healthcheck.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/resty/healthcheck.lua b/lib/resty/healthcheck.lua index 8b3bd47b..8ff96098 100644 --- a/lib/resty/healthcheck.lua +++ b/lib/resty/healthcheck.lua @@ -756,10 +756,11 @@ function checker:run_single_check(ip, port, hostname) if self.checks.active.type == "https" then local session - session = sock:sslhandshake(nil, hostname, + session, err = sock:sslhandshake(nil, hostname, self.checks.active.https_verify_certificate) if not session then sock:close() + self:log(ERR, "failed SSL handshake with '", hostname, " (", ip, ":", port, ")': ", err) return self:report_tcp_failure(ip, port, hostname, "connect", "active") end end