Software / code / prosody
Changeset
5596:73fea1a87afd
mod_admin_telnet: Don't rely on getpeerchain returning an empty list
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sat, 18 May 2013 13:11:44 +0200 |
| parents | 5594:ad66ee47b674 |
| children | 5597:6fe09707c73b |
| files | plugins/mod_admin_telnet.lua |
| diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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();