Skip to content

Commit

Permalink
use sock:sslhandshake instead of sock:tlshandshake (#8376)
Browse files Browse the repository at this point in the history
  • Loading branch information
chronolaw authored Feb 9, 2022
1 parent 1c1b394 commit a2d249e
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions kong/reports.lua
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,8 @@ local _ping_infos = {}
local _enabled = false
local _unique_str = utils.random_string()
local _buffer_immutable_idx
local _tls_session
local _tls_opts = {
ssl_verify = false,
}
local _ssl_session
local _ssl_verify = false

-- the resty.counter instance, will be initialized in `init_worker`
local report_counter = nil
Expand Down Expand Up @@ -148,14 +146,13 @@ local function send_report(signal_type, t, host, port)
return
end

_tls_opts.reused_session = _tls_session
local hs_ok, err = sock:tlshandshake(_tls_opts)
local hs_ok, err = sock:sslhandshake(_ssl_session, nil, _ssl_verify)
if not hs_ok then
log(DEBUG, "failed to complete TLS handshake for reports: ", err)
log(DEBUG, "failed to complete SSL handshake for reports: ", err)
return
end

_tls_session = hs_ok
_ssl_session = hs_ok

sock:send(concat(_buffer, ";", 1, mutable_idx) .. "\n")
sock:setkeepalive()
Expand Down

0 comments on commit a2d249e

Please sign in to comment.