# HG changeset patch # User Kim Alvefur # Date 1705874390 -3600 # Node ID 3c80124452ed69d70c5b0c0a00a902bfec4c715e # Parent 92301fa7a673c2f6ee6a9277739f721da31b8ec0 net.server_epoll: Prevent traceback when checking TLS after connection gone Unclear why this would be done, but an error is not great. diff -r 92301fa7a673 -r 3c80124452ed net/server_epoll.lua --- a/net/server_epoll.lua Tue Feb 20 17:31:17 2024 +0000 +++ b/net/server_epoll.lua Sun Jan 21 22:59:50 2024 +0100 @@ -630,30 +630,35 @@ 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