# HG changeset patch # User Florian Zeitz # Date 1374528182 -7200 # Node ID d643c385d3f6996d1ce0636d417024e3dc36b968 # Parent 2345a30dd8b4257de841a9a2907766cd27983474 mod_admin_web: Provide some information about the TLS layer diff -r 2345a30dd8b4 -r d643c385d3f6 mod_admin_web/admin_web/mod_admin_web.lua --- a/mod_admin_web/admin_web/mod_admin_web.lua Sat Jul 13 17:43:30 2013 +0200 +++ b/mod_admin_web/admin_web/mod_admin_web.lua Mon Jul 22 23:23:02 2013 +0200 @@ -42,7 +42,12 @@ end local item = st.stanza("item", { id = id }):tag("session", {xmlns = xmlns_c2s_session, jid = name}):up(); if session.secure then - item:tag("encrypted"):up(); + local encrypted = item:tag("encrypted"); + local sock = session.conn and session.conn.socket and session.conn:socket() + local info = sock and sock.info and sock:info(); + for k, v in pairs(info or {}) do + encrypted:tag("info", { name = k }):text(tostring(v)):up(); + end end if session.compressed then item:tag("compressed"):up(); @@ -70,10 +75,19 @@ local item = st.stanza("item", { id = id }):tag("session", {xmlns = xmlns_s2s_session, jid = name}) :tag(type):up(); if session.secure then + local encrypted = item:tag("encrypted"); + + local sock = session.conn and session.conn.socket and session.conn:socket() + local info = sock and sock.info and sock:info(); + for k, v in pairs(info or {}) do + encrypted:tag("info", { name = k }):text(tostring(v)):up(); + end + local sock = session.conn:socket() + if session.cert_identity_status == "valid" then - item:tag("encrypted"):tag("valid"):up():up(); + encrypted:tag("valid"); else - item:tag("encrypted"):tag("invalid"):up():up(); + encrypted:tag("invalid"); end end if session.compressed then diff -r 2345a30dd8b4 -r d643c385d3f6 mod_admin_web/admin_web/www_files/css/style.css --- a/mod_admin_web/admin_web/www_files/css/style.css Sat Jul 13 17:43:30 2013 +0200 +++ b/mod_admin_web/admin_web/www_files/css/style.css Mon Jul 22 23:23:02 2013 +0200 @@ -6,7 +6,7 @@ color: #0000FF } -ul { +#adhocCommands > ul { margin: 0 } diff -r 2345a30dd8b4 -r d643c385d3f6 mod_admin_web/admin_web/www_files/js/main.js --- a/mod_admin_web/admin_web/www_files/js/main.js Sat Jul 13 17:43:30 2013 +0200 +++ b/mod_admin_web/admin_web/www_files/js/main.js Mon Jul 22 23:23:02 2013 +0200 @@ -26,23 +26,36 @@ } function _cbNewS2S(e) { - var items, entry, tmp, retract, id, jid; + var items, item, entry, tmp, retract, id, jid, infos, info, metadata; items = e.getElementsByTagName('item'); for (i = 0; i < items.length; i++) { - id = items[i].attributes.getNamedItem('id').value; - jid = items[i].getElementsByTagName('session')[0].attributes.getNamedItem('jid').value; + item = items[i]; + id = item.attributes.getNamedItem('id').value; + jid = item.getElementsByTagName('session')[0].attributes.getNamedItem('jid').value; + infos = item.getElementsByTagName('info'); entry = $('
  • ' + jid + '
  • '); - if (tmp = items[i].getElementsByTagName('encrypted')[0]) { + if (tmp = item.getElementsByTagName('encrypted')[0]) { if (tmp.getElementsByTagName('valid')[0]) { entry.append(' (secure) (encrypted)'); } else { entry.append(' (encrypted)'); } } - if (items[i].getElementsByTagName('compressed')[0]) { + if (item.getElementsByTagName('compressed')[0]) { entry.append(' (compressed)'); } + metadata = $('