Software / code / prosody
Comparison
plugins/mod_admin_shell.lua @ 12293:145cb8305c67
mod_admin_shell: Squeeze some characters out of the Certificate column
The more compact these are, the better
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Thu, 17 Feb 2022 01:41:57 +0100 |
| parent | 12291:ec16fb706247 |
| child | 12304:8210c2a52e9c |
comparison
equal
deleted
inserted
replaced
| 12292:7fe5cd8a10e2 | 12293:145cb8305c67 |
|---|---|
| 817 }; | 817 }; |
| 818 cert = { | 818 cert = { |
| 819 title = "Certificate"; | 819 title = "Certificate"; |
| 820 description = "Validation status of certificate"; | 820 description = "Validation status of certificate"; |
| 821 key = "cert_identity_status"; | 821 key = "cert_identity_status"; |
| 822 width = 13; | 822 width = 11; |
| 823 mapper = function(cert_status, session) | 823 mapper = function(cert_status, session) |
| 824 if cert_status then return capitalize(cert_status); end | 824 if cert_status then return capitalize(cert_status); end |
| 825 if session.cert_chain_status == "Invalid" then | 825 if session.cert_chain_status == "Invalid" then |
| 826 local cert_errors = set.new(session.cert_chain_errors[1]); | 826 local cert_errors = set.new(session.cert_chain_errors[1]); |
| 827 if cert_errors:contains("certificate has expired") then | 827 if cert_errors:contains("certificate has expired") then |
| 831 end | 831 end |
| 832 return "Untrusted"; | 832 return "Untrusted"; |
| 833 elseif session.cert_identity_status == "invalid" then | 833 elseif session.cert_identity_status == "invalid" then |
| 834 return "Mismatched"; | 834 return "Mismatched"; |
| 835 end | 835 end |
| 836 return "Not validated"; | 836 return "Unknown"; |
| 837 end; | 837 end; |
| 838 }; | 838 }; |
| 839 sni = { | 839 sni = { |
| 840 title = "SNI"; | 840 title = "SNI"; |
| 841 description = "Hostname requested in TLS"; | 841 description = "Hostname requested in TLS"; |