Comparison

plugins/mod_tls.lua @ 2602:dff84fdebac0

mod_tls: Remove origin type check when TLS is requested (thanks MattJ).
author Waqas Hussain <waqas20@gmail.com>
date Fri, 12 Feb 2010 02:43:02 +0500
parent 2601:e64c6a4aa50b
child 2604:ed32f7bad620
comparison
equal deleted inserted replaced
2601:e64c6a4aa50b 2602:dff84fdebac0
16 16
17 local global_ssl_ctx = prosody.global_ssl_ctx; 17 local global_ssl_ctx = prosody.global_ssl_ctx;
18 18
19 module:hook("stanza/urn:ietf:params:xml:ns:xmpp-tls:starttls", function(event) 19 module:hook("stanza/urn:ietf:params:xml:ns:xmpp-tls:starttls", function(event)
20 local origin = event.origin; 20 local origin = event.origin;
21 if origin.conn.starttls and origin.type == "c2s_unauthed" or origin.type == "s2sin_unauthed" then 21 if origin.conn.starttls then
22 (origin.sends2s or origin.send)(st.stanza("proceed", { xmlns = xmlns_starttls })); 22 (origin.sends2s or origin.send)(st.stanza("proceed", { xmlns = xmlns_starttls }));
23 origin:reset_stream(); 23 origin:reset_stream();
24 local host = origin.to_host or origin.host; 24 local host = origin.to_host or origin.host;
25 local ssl_ctx = host and hosts[host].ssl_ctx_in or global_ssl_ctx; 25 local ssl_ctx = host and hosts[host].ssl_ctx_in or global_ssl_ctx;
26 origin.conn:starttls(ssl_ctx); 26 origin.conn:starttls(ssl_ctx);