Software /
code /
prosody
Comparison
plugins/mod_tls.lua @ 7833:94c0c8649826
mod_tls: Only accept <proceed> on outgoing s2s connections
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Mon, 23 Jan 2017 10:45:20 +0100 |
parent | 7712:0d93dfc2fbfd |
child | 7834:a2081d28bd22 |
comparison
equal
deleted
inserted
replaced
7832:d02ef0ae94af | 7833:94c0c8649826 |
---|---|
122 return true; | 122 return true; |
123 end | 123 end |
124 end, 500); | 124 end, 500); |
125 | 125 |
126 module:hook_stanza(xmlns_starttls, "proceed", function (session, stanza) -- luacheck: ignore 212/stanza | 126 module:hook_stanza(xmlns_starttls, "proceed", function (session, stanza) -- luacheck: ignore 212/stanza |
127 module:log("debug", "Proceeding with TLS on s2sout..."); | 127 if session.type == "s2sout_unauthed" then |
128 session:reset_stream(); | 128 module:log("debug", "Proceeding with TLS on s2sout..."); |
129 session.conn:starttls(session.ssl_ctx); | 129 session:reset_stream(); |
130 session.secure = false; | 130 session.conn:starttls(session.ssl_ctx); |
131 return true; | 131 session.secure = false; |
132 return true; | |
133 end | |
132 end); | 134 end); |