From 06ac071f742aeb498474ea8a4253d20fe0c87142 Mon Sep 17 00:00:00 2001 From: Zhefeng Chen Date: Mon, 14 Oct 2024 16:37:39 +0800 Subject: [PATCH] chore(fixture): fix tcp_server, SSL_shutdown only does a half close, so the connection can still be reused. --- spec/internal/ssl.lua | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/spec/internal/ssl.lua b/spec/internal/ssl.lua index 03714ce4badc..241f12282b08 100644 --- a/spec/internal/ssl.lua +++ b/spec/internal/ssl.lua @@ -152,12 +152,12 @@ function SSL.wrap(sock, cfg) if s then local fd = sock:getfd() C.SSL_set_fd(s, fd) - sock:setfd(SOCKET_INVALID) local self = setmetatable({ ssl_ctx = ctx, ctx = s, fd = fd, + sock = sock, }, ssl_mt) return self, nil @@ -259,9 +259,7 @@ function SSL:send(s) end function SSL:close() - if C.SSL_shutdown(self.ctx) ~= 1 then - return nil, format_error("SSL_shutdown") - end + self.sock:close() return true end