Comparison

plugins/mod_admin_shell.lua @ 11905:bbfa707a4756

mod_admin_shell: Handle absence of connection in security column (thanks arcseconds) I surmise this can happen in a disconnected/smacks hibernation state.
author Kim Alvefur <zash@zash.se>
date Mon, 15 Nov 2021 13:31:06 +0100
parent 11892:e712133b4de1
child 11917:d27b74b25105
comparison
equal deleted inserted replaced
11904:313d01cc4258 11905:bbfa707a4756
708 title = "Security"; 708 title = "Security";
709 key = "conn"; 709 key = "conn";
710 width = 11; 710 width = 11;
711 mapper = function(conn, session) 711 mapper = function(conn, session)
712 if not session.secure then return "insecure"; end 712 if not session.secure then return "insecure"; end
713 if not conn:ssl() then return "secure" end 713 if not conn or not conn:ssl() then return "secure" end
714 local sock = conn and conn:socket(); 714 local sock = conn and conn:socket();
715 if not sock then return "unknown TLS"; end 715 if not sock then return "unknown TLS"; end
716 local tls_info = sock.info and sock:info(); 716 local tls_info = sock.info and sock:info();
717 return tls_info and tls_info.protocol or "unknown TLS"; 717 return tls_info and tls_info.protocol or "unknown TLS";
718 end; 718 end;