From 83fc029e98fcb28091760be541b4c3d6e0db39e8 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sat, 18 May 2013 13:11:44 +0200 Subject: mod_admin_telnet: Don't rely on getpeerchain returning an empty list --- plugins/mod_admin_telnet.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins') 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(); -- cgit v1.2.3