Skip to content

Commit

Permalink
fix(log) log error on ssl handshake failure
Browse files Browse the repository at this point in the history
  • Loading branch information
onematchfox committed Sep 10, 2019
1 parent 0250046 commit 918e440
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/resty/healthcheck.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 918e440

Please sign in to comment.