diff options
author | Kim Alvefur <zash@zash.se> | 2015-05-19 16:33:47 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2015-05-19 16:33:47 +0200 |
commit | cc380360ef8163b0922b2e31eced37ce9b64c45e (patch) | |
tree | 14a722959d1179338adec58efd9e5d7fcfa58ada /plugins/mod_tls.lua | |
parent | a1eac64a926aeeec8babac775aa689dab4a598d3 (diff) | |
parent | e909a53de56e66db08941f06f796b1bedda95a1f (diff) | |
download | prosody-cc380360ef8163b0922b2e31eced37ce9b64c45e.tar.gz prosody-cc380360ef8163b0922b2e31eced37ce9b64c45e.zip |
Merge 0.10->trunk
Diffstat (limited to 'plugins/mod_tls.lua')
-rw-r--r-- | plugins/mod_tls.lua | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/mod_tls.lua b/plugins/mod_tls.lua index f9d2cee9..d1138e1c 100644 --- a/plugins/mod_tls.lua +++ b/plugins/mod_tls.lua @@ -21,6 +21,7 @@ end local xmlns_starttls = 'urn:ietf:params:xml:ns:xmpp-tls'; local starttls_attr = { xmlns = xmlns_starttls }; +local starttls_initiate= st.stanza("starttls", starttls_attr); local starttls_proceed = st.stanza("proceed", starttls_attr); local starttls_failure = st.stanza("failure", starttls_attr); local c2s_feature = st.stanza("starttls", starttls_attr); @@ -60,7 +61,7 @@ do end local function can_do_tls(session) - if not session.conn.starttls then + if session.ssl_ctx == false or not session.conn.starttls then return false; elseif session.ssl_ctx then return true; @@ -116,7 +117,7 @@ module:hook_stanza("http://etherx.jabber.org/streams", "features", function (ses module:log("debug", "Received features element"); if can_do_tls(session) and stanza:get_child("starttls", xmlns_starttls) then module:log("debug", "%s is offering TLS, taking up the offer...", session.to_host); - session.sends2s("<starttls xmlns='"..xmlns_starttls.."'/>"); + session.sends2s(starttls_initiate); return true; end end, 500); |