Skip to content

Commit

Permalink
Log error on SSL handshake failure - don't fail silently
Browse files Browse the repository at this point in the history
  • Loading branch information
onematchfox committed Sep 6, 2019
1 parent 0250046 commit 813893b
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 813893b

Please sign in to comment.