aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2013-08-02 15:12:24 +0200
committerKim Alvefur <zash@zash.se>2013-08-02 15:12:24 +0200
commite1f147d556b9db5732b6c37502d2f8059e15363b (patch)
treeeba30f4d57c10d3585a8c663823d4f5cee77d5b4 /plugins
parent74c8b94006f33a24a922d8e5885bee417baf2213 (diff)
downloadprosody-e1f147d556b9db5732b6c37502d2f8059e15363b.tar.gz
prosody-e1f147d556b9db5732b6c37502d2f8059e15363b.zip
mod_c2s, mod_s2s: Log a message that stream encryption has been enabled with some details
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_c2s.lua11
-rw-r--r--plugins/mod_s2s/mod_s2s.lua11
2 files changed, 14 insertions, 8 deletions
diff --git a/plugins/mod_c2s.lua b/plugins/mod_c2s.lua
index 3eb9e975..c26c5510 100644
--- a/plugins/mod_c2s.lua
+++ b/plugins/mod_c2s.lua
@@ -68,12 +68,15 @@ function stream_callbacks.streamopened(session, attr)
if session.secure == false then
session.secure = true;
- -- Check if TLS compression is used
local sock = session.conn:socket();
if sock.info then
- session.compressed = sock:info"compression";
- elseif sock.compression then
- session.compressed = sock:compression(); --COMPAT mw/luasec-hg
+ local info = sock:info();
+ (session.log or log)("info", "Stream encrypted (%s) with %s, authenticated with %s and exchanged keys with %s",
+ info.protocol, info.encryption, info.authentication, info.key);
+ session.compressed = info.compression;
+ else
+ (session.log or log)("info", "Stream encrypted");
+ session.compressed = sock.compression and sock:compression(); --COMPAT mw/luasec-hg
end
end
diff --git a/plugins/mod_s2s/mod_s2s.lua b/plugins/mod_s2s/mod_s2s.lua
index 01fac4d2..b6614d2f 100644
--- a/plugins/mod_s2s/mod_s2s.lua
+++ b/plugins/mod_s2s/mod_s2s.lua
@@ -283,12 +283,15 @@ function stream_callbacks.streamopened(session, attr)
if session.secure == false then
session.secure = true;
- -- Check if TLS compression is used
local sock = session.conn:socket();
if sock.info then
- session.compressed = sock:info"compression";
- elseif sock.compression then
- session.compressed = sock:compression(); --COMPAT mw/luasec-hg
+ local info = sock:info();
+ (session.log or log)("info", "Stream encrypted (%s) with %s, authenticated with %s and exchanged keys with %s",
+ info.protocol, info.encryption, info.authentication, info.key);
+ session.compressed = info.compression;
+ else
+ (session.log or log)("info", "Stream encrypted");
+ session.compressed = sock.compression and sock:compression(); --COMPAT mw/luasec-hg
end
end