Mercurial > prosody-hg
comparison plugins/mod_tls.lua @ 7834:a2081d28bd22
mod_tls: Verify that TLS is available before proceeding
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Mon, 23 Jan 2017 10:46:42 +0100 |
| parents | 94c0c8649826 |
| children | a634fe3c21f2 |
comparison
equal
deleted
inserted
replaced
| 7833:94c0c8649826 | 7834:a2081d28bd22 |
|---|---|
| 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 if session.type == "s2sout_unauthed" then | 127 if session.type == "s2sout_unauthed" and can_do_tls(session) then |
| 128 module:log("debug", "Proceeding with TLS on s2sout..."); | 128 module:log("debug", "Proceeding with TLS on s2sout..."); |
| 129 session:reset_stream(); | 129 session:reset_stream(); |
| 130 session.conn:starttls(session.ssl_ctx); | 130 session.conn:starttls(session.ssl_ctx); |
| 131 session.secure = false; | 131 session.secure = false; |
| 132 return true; | 132 return true; |
