Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(*) use sock:sslhandshake instead of sock:tlshandshake #8376

Merged
merged 1 commit into from
Feb 9, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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