aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_admin_telnet.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2013-05-18 13:11:44 +0200
committerKim Alvefur <zash@zash.se>2013-05-18 13:11:44 +0200
commit191e1f2b0f4102e3062a2e9267e8f5cd7db32b07 (patch)
tree74327dc77bd90a5d12e6b394f682890bd51bf0ab /plugins/mod_admin_telnet.lua
parent28cc47291a7c489e3c130bf406a605022d923c5d (diff)
downloadprosody-191e1f2b0f4102e3062a2e9267e8f5cd7db32b07.tar.gz
prosody-191e1f2b0f4102e3062a2e9267e8f5cd7db32b07.zip
mod_admin_telnet: Don't rely on getpeerchain returning an empty list
Diffstat (limited to 'plugins/mod_admin_telnet.lua')
-rw-r--r--plugins/mod_admin_telnet.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/mod_admin_telnet.lua b/plugins/mod_admin_telnet.lua
index 753e2d2c..92c11d4b 100644
--- a/plugins/mod_admin_telnet.lua
+++ b/plugins/mod_admin_telnet.lua
@@ -682,9 +682,9 @@ function def_env.s2s:showcert(domain)
error("This version of LuaSec does not support certificate viewing");
end
else
- local certs = conn:getpeerchain();
- local cert = certs[1];
+ local cert = conn:getpeercertificate();
if cert then
+ local certs = conn:getpeerchain();
local digest = cert:digest("sha1");
if not cert_set[digest] then
local chain_valid, chain_errors = conn:getpeerverification();