diff options
author | Kim Alvefur <zash@zash.se> | 2020-03-22 21:13:09 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2020-03-22 21:13:09 +0100 |
commit | 6bfe774cab77d494a15da52a289cfb4b68de6d7a (patch) | |
tree | 34537ef426e6f55fa507b93b2479506d3865da93 /plugins/mod_admin_telnet.lua | |
parent | b9c78541d727cfef9d016ff6c471bb46830280e2 (diff) | |
parent | 277b88a8def42159d4e77f12ddb462caba55d7c3 (diff) | |
download | prosody-6bfe774cab77d494a15da52a289cfb4b68de6d7a.tar.gz prosody-6bfe774cab77d494a15da52a289cfb4b68de6d7a.zip |
Merge 0.11->trunk
Diffstat (limited to 'plugins/mod_admin_telnet.lua')
-rw-r--r-- | plugins/mod_admin_telnet.lua | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/plugins/mod_admin_telnet.lua b/plugins/mod_admin_telnet.lua index 4dc32e47..2efd424c 100644 --- a/plugins/mod_admin_telnet.lua +++ b/plugins/mod_admin_telnet.lua @@ -596,9 +596,14 @@ local function tls_info(session, line) 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 @@ local function tls_info(session, line) line[#line+1] = ("(ALPN:%q)"):format(proto); end end - else - line[#line+1] = "(cipher info unavailable)"; end else line[#line+1] = "(insecure)"; |