# HG changeset patch # User Kim Alvefur # Date 1368875504 -7200 # Node ID 73fea1a87afd24437b12c921e39ec631817c1542 # Parent ad66ee47b67445778088178a7375cf00bd7ea08c mod_admin_telnet: Don't rely on getpeerchain returning an empty list diff -r ad66ee47b674 -r 73fea1a87afd plugins/mod_admin_telnet.lua --- a/plugins/mod_admin_telnet.lua Sat May 18 12:02:25 2013 +0100 +++ b/plugins/mod_admin_telnet.lua Sat May 18 13:11:44 2013 +0200 @@ -682,9 +682,9 @@ 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();