Diff

plugins/mod_admin_telnet.lua @ 10701:929c95e518f0

Merge 0.11->trunk
author Kim Alvefur <zash@zash.se>
date Sun, 22 Mar 2020 21:13:09 +0100
parent 10663:fd651ba2317f
parent 10699:fd77b6cec38d
child 10787:459efb1afbfe
line wrap: on
line diff
--- a/plugins/mod_admin_telnet.lua	Sat Mar 21 00:00:50 2020 +0100
+++ b/plugins/mod_admin_telnet.lua	Sun Mar 22 21:13:09 2020 +0100
@@ -596,9 +596,14 @@
 	common_info(session, line);
 	if session.secure then
 		local sock = session.conn and session.conn.socket and session.conn:socket();
-		if sock and sock.info then
-			local info = sock:info();
-			line[#line+1] = ("(%s with %s)"):format(info.protocol, info.cipher);
+		if sock then
+			local info = sock.info and sock:info();
+			if info then
+				line[#line+1] = ("(%s with %s)"):format(info.protocol, info.cipher);
+			else
+				-- TLS session might not be ready yet
+				line[#line+1] = "(cipher info unavailable)";
+			end
 			if sock.getsniname then
 				local name = sock:getsniname();
 				if name then
@@ -611,8 +616,6 @@
 					line[#line+1] = ("(ALPN:%q)"):format(proto);
 				end
 			end
-		else
-			line[#line+1] = "(cipher info unavailable)";
 		end
 	else
 		line[#line+1] = "(insecure)";