diff options
author | Kim Alvefur <zash@zash.se> | 2024-01-21 22:59:50 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2024-01-21 22:59:50 +0100 |
commit | 5764e73a65351f9284e309fe423b3001fc4265c9 (patch) | |
tree | 30fa352af44311b48759b8b6b61ec7380af372bb | |
parent | 69dc40ac35814f46b135fce1295e073a4659b6f0 (diff) | |
download | prosody-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.
-rw-r--r-- | net/server_epoll.lua | 5 |
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 |