From 918e4402f5e91efbfe7a5f5966fca9a2ecc01248 Mon Sep 17 00:00:00 2001 From: Brian Fox Date: Fri, 6 Sep 2019 16:03:35 +0200 Subject: [PATCH] fix(log) log error on ssl handshake failure --- 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