Comparison

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
comparison
equal deleted inserted replaced
10698:e4034f6668a5 10701:929c95e518f0
594 local function tls_info(session, line) 594 local function tls_info(session, line)
595 line = line or {}; 595 line = line or {};
596 common_info(session, line); 596 common_info(session, line);
597 if session.secure then 597 if session.secure then
598 local sock = session.conn and session.conn.socket and session.conn:socket(); 598 local sock = session.conn and session.conn.socket and session.conn:socket();
599 if sock and sock.info then 599 if sock then
600 local info = sock:info(); 600 local info = sock.info and sock:info();
601 line[#line+1] = ("(%s with %s)"):format(info.protocol, info.cipher); 601 if info then
602 line[#line+1] = ("(%s with %s)"):format(info.protocol, info.cipher);
603 else
604 -- TLS session might not be ready yet
605 line[#line+1] = "(cipher info unavailable)";
606 end
602 if sock.getsniname then 607 if sock.getsniname then
603 local name = sock:getsniname(); 608 local name = sock:getsniname();
604 if name then 609 if name then
605 line[#line+1] = ("(SNI:%q)"):format(name); 610 line[#line+1] = ("(SNI:%q)"):format(name);
606 end 611 end
609 local proto = sock:getalpn(); 614 local proto = sock:getalpn();
610 if proto then 615 if proto then
611 line[#line+1] = ("(ALPN:%q)"):format(proto); 616 line[#line+1] = ("(ALPN:%q)"):format(proto);
612 end 617 end
613 end 618 end
614 else
615 line[#line+1] = "(cipher info unavailable)";
616 end 619 end
617 else 620 else
618 line[#line+1] = "(insecure)"; 621 line[#line+1] = "(insecure)";
619 end 622 end
620 return table.concat(line, " "); 623 return table.concat(line, " ");