Software / code / prosody
Comparison
plugins/mod_tls.lua @ 2802:ded1c649484a
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 | 1981:ffbc57a4dea8 |
| child | 2877:1edeb8fe7d14 |
comparison
equal
deleted
inserted
replaced
| 2801:0323bdb1fcfa | 2802:ded1c649484a |
|---|---|
| 88 | 88 |
| 89 module:hook_stanza(xmlns_starttls, "proceed", | 89 module:hook_stanza(xmlns_starttls, "proceed", |
| 90 function (session, stanza) | 90 function (session, stanza) |
| 91 module:log("debug", "Proceeding with TLS on s2sout..."); | 91 module:log("debug", "Proceeding with TLS on s2sout..."); |
| 92 local format, to_host, from_host = string.format, session.to_host, session.from_host; | 92 local format, to_host, from_host = string.format, session.to_host, session.from_host; |
| 93 local ssl_ctx = session.from_host and hosts[session.from_host].ssl_ctx or global_ssl_ctx; | |
| 94 session.conn.set_sslctx(ssl_ctx); | |
| 93 session:reset_stream(); | 95 session:reset_stream(); |
| 94 session.conn.starttls(true); | 96 session.conn.starttls(true); |
| 95 session.secure = false; | 97 session.secure = false; |
| 96 return true; | 98 return true; |
| 97 end); | 99 end); |