Skip to content

Commit

Permalink
chore(fixture): fix tcp_server, SSL_shutdown only does a half close,
Browse files Browse the repository at this point in the history
    so the connection can still be reused.
  • Loading branch information
catbro666 committed Oct 14, 2024
1 parent afba66b commit 06ac071
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions spec/internal/ssl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 06ac071

Please sign in to comment.