Comparison

plugins/mod_tls.lua @ 5987:bd90250ee1ee

mod_tls: Rename variables to be less confusing
author Kim Alvefur <zash@zash.se>
date Wed, 15 Jan 2014 21:57:15 +0100
parent 5976:872ff4851c9b
child 5988:177f233b5211
comparison
equal deleted inserted replaced
5977:3f22f0de30f8 5987:bd90250ee1ee
8 8
9 local config = require "core.configmanager"; 9 local config = require "core.configmanager";
10 local create_context = require "core.certmanager".create_context; 10 local create_context = require "core.certmanager".create_context;
11 local st = require "util.stanza"; 11 local st = require "util.stanza";
12 12
13 local secure_auth_only = 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 secure_s2s_only = 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 16
17 local xmlns_starttls = 'urn:ietf:params:xml:ns:xmpp-tls'; 17 local xmlns_starttls = 'urn:ietf:params:xml:ns:xmpp-tls';
18 local starttls_attr = { xmlns = xmlns_starttls }; 18 local starttls_attr = { xmlns = xmlns_starttls };
19 local starttls_proceed = st.stanza("proceed", starttls_attr); 19 local starttls_proceed = st.stanza("proceed", starttls_attr);
20 local starttls_failure = st.stanza("failure", starttls_attr); 20 local starttls_failure = st.stanza("failure", starttls_attr);
21 local c2s_feature = st.stanza("starttls", starttls_attr); 21 local c2s_feature = st.stanza("starttls", starttls_attr);
22 local s2s_feature = st.stanza("starttls", starttls_attr); 22 local s2s_feature = st.stanza("starttls", starttls_attr);
23 if secure_auth_only then c2s_feature:tag("required"):up(); end 23 if c2s_require_encryption then c2s_feature:tag("required"):up(); end
24 if secure_s2s_only then s2s_feature:tag("required"):up(); end 24 if s2s_require_encryption then s2s_feature:tag("required"):up(); end
25 25
26 local global_ssl_ctx = prosody.global_ssl_ctx; 26 local global_ssl_ctx = prosody.global_ssl_ctx;
27 27
28 local hosts = prosody.hosts; 28 local hosts = prosody.hosts;
29 local host = hosts[module.host]; 29 local host = hosts[module.host];