aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2024-01-21 22:59:50 +0100
committerKim Alvefur <zash@zash.se>2024-01-21 22:59:50 +0100
commit5764e73a65351f9284e309fe423b3001fc4265c9 (patch)
tree30fa352af44311b48759b8b6b61ec7380af372bb /net
parent69dc40ac35814f46b135fce1295e073a4659b6f0 (diff)
downloadprosody-5764e73a65351f9284e309fe423b3001fc4265c9.tar.gz
prosody-5764e73a65351f9284e309fe423b3001fc4265c9.zip
net.server_epoll: Prevent traceback when checking TLS after connection gone
Unclear why this would be done, but an error is not great.
Diffstat (limited to 'net')
-rw-r--r--net/server_epoll.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/server_epoll.lua b/net/server_epoll.lua
index fe60dc78..18c18823 100644
--- a/net/server_epoll.lua
+++ b/net/server_epoll.lua
@@ -630,30 +630,35 @@ end
function interface:ssl_info()
local sock = self.conn;
+ if not sock then return nil, "not-connected" end
if not sock.info then return nil, "not-implemented"; end
return sock:info();
end
function interface:ssl_peercertificate()
local sock = self.conn;
+ if not sock then return nil, "not-connected" end
if not sock.getpeercertificate then return nil, "not-implemented"; end
return sock:getpeercertificate();
end
function interface:ssl_peerverification()
local sock = self.conn;
+ if not sock then return nil, "not-connected" end
if not sock.getpeerverification then return nil, { { "Chain verification not supported" } }; end
return sock:getpeerverification();
end
function interface:ssl_peerfinished()
local sock = self.conn;
+ if not sock then return nil, "not-connected" end
if not sock.getpeerfinished then return nil, "not-implemented"; end
return sock:getpeerfinished();
end
function interface:ssl_exportkeyingmaterial(label, len, context)
local sock = self.conn;
+ if not sock then return nil, "not-connected" end
if sock.exportkeyingmaterial then
return sock:exportkeyingmaterial(label, len, context);
end