Comparison

plugins/mod_tls.lua @ 5988:177f233b5211

mod_tls: Let s2s_secure_auth override s2s_require_encryption and warn if they differ
author Kim Alvefur <zash@zash.se>
date Wed, 15 Jan 2014 22:47:50 +0100
parent 5987:bd90250ee1ee
child 5993:ef11b8bab405
comparison
equal deleted inserted replaced
5987:bd90250ee1ee 5988:177f233b5211
11 local st = require "util.stanza"; 11 local st = require "util.stanza";
12 12
13 local c2s_require_encryption = module:get_option("c2s_require_encryption") or module:get_option("require_encryption"); 13 local c2s_require_encryption = module:get_option("c2s_require_encryption") or module:get_option("require_encryption");
14 local s2s_require_encryption = module:get_option("s2s_require_encryption"); 14 local s2s_require_encryption = module:get_option("s2s_require_encryption");
15 local allow_s2s_tls = module:get_option("s2s_allow_encryption") ~= false; 15 local allow_s2s_tls = module:get_option("s2s_allow_encryption") ~= false;
16 local s2s_secure_auth = module:get_option("s2s_secure_auth");
17
18 if s2s_secure_auth and s2s_require_encryption == false then
19 module:log("warn", "s2s_secure_auth implies s2s_require_encryption, but s2s_require_encryption is set to false");
20 s2s_require_encryption = true;
21 end
16 22
17 local xmlns_starttls = 'urn:ietf:params:xml:ns:xmpp-tls'; 23 local xmlns_starttls = 'urn:ietf:params:xml:ns:xmpp-tls';
18 local starttls_attr = { xmlns = xmlns_starttls }; 24 local starttls_attr = { xmlns = xmlns_starttls };
19 local starttls_proceed = st.stanza("proceed", starttls_attr); 25 local starttls_proceed = st.stanza("proceed", starttls_attr);
20 local starttls_failure = st.stanza("failure", starttls_attr); 26 local starttls_failure = st.stanza("failure", starttls_attr);