From a2d249e07703045a8b74190a0115c3671350893c Mon Sep 17 00:00:00 2001 From: Chrono Date: Thu, 10 Feb 2022 07:36:39 +0800 Subject: [PATCH] use sock:sslhandshake instead of sock:tlshandshake (#8376) --- kong/reports.lua | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/kong/reports.lua b/kong/reports.lua index 1a1f9aa5656b..db65bda24c59 100644 --- a/kong/reports.lua +++ b/kong/reports.lua @@ -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 @@ -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()