Software /
code /
prosody
Comparison
plugins/mod_tls.lua @ 2543:da16a5c0df85
mod_tls: Set the sslctx on outgoing connections (possibly the cause of outgoing s2s connections not being encrypted)
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Sun, 31 Jan 2010 15:39:49 +0000 |
parent | 2542:0a78847b38e2 |
child | 2544:b68cbc664d18 |
comparison
equal
deleted
inserted
replaced
2542:0a78847b38e2 | 2543:da16a5c0df85 |
---|---|
87 module:hook_stanza(xmlns_starttls, "proceed", | 87 module:hook_stanza(xmlns_starttls, "proceed", |
88 function (session, stanza) | 88 function (session, stanza) |
89 module:log("debug", "Proceeding with TLS on s2sout..."); | 89 module:log("debug", "Proceeding with TLS on s2sout..."); |
90 local format, to_host, from_host = string.format, session.to_host, session.from_host; | 90 local format, to_host, from_host = string.format, session.to_host, session.from_host; |
91 session:reset_stream(); | 91 session:reset_stream(); |
92 session.conn:starttls(true); | 92 local ssl_ctx = session.from_host and hosts[session.from_host].ssl_ctx or global_ssl_ctx; |
93 session.conn:starttls(ssl_ctx, true); | |
93 session.secure = false; | 94 session.secure = false; |
94 return true; | 95 return true; |
95 end); | 96 end); |