Mercurial > prosody-hg
comparison plugins/mod_tls.lua @ 11341:c567e5e2b77a
mod_tls: Ignore lack of STARTTLS offer only when s2s_require_encryption set
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Fri, 29 Jan 2021 23:23:25 +0100 |
| parents | a7109eb45e30 |
| children | df4bd3af4099 |
comparison
equal
deleted
inserted
replaced
| 11340:a7109eb45e30 | 11341:c567e5e2b77a |
|---|---|
| 151 module:hook_tag("http://etherx.jabber.org/streams", "features", function (session, stanza) | 151 module:hook_tag("http://etherx.jabber.org/streams", "features", function (session, stanza) |
| 152 module:log("debug", "Received features element"); | 152 module:log("debug", "Received features element"); |
| 153 if can_do_tls(session) then | 153 if can_do_tls(session) then |
| 154 if stanza:get_child("starttls", xmlns_starttls) then | 154 if stanza:get_child("starttls", xmlns_starttls) then |
| 155 module:log("debug", "%s is offering TLS, taking up the offer...", session.to_host); | 155 module:log("debug", "%s is offering TLS, taking up the offer...", session.to_host); |
| 156 elseif s2s_require_encryption then | |
| 157 module:log("debug", "%s is *not* offering TLS, trying anyways!", session.to_host); | |
| 156 else | 158 else |
| 157 module:log("debug", "%s is *not* offering TLS, trying anyways!", session.to_host); | 159 module:log("debug", "%s is not offering TLS", session.to_host); |
| 160 return; | |
| 158 end | 161 end |
| 159 session.sends2s(starttls_initiate); | 162 session.sends2s(starttls_initiate); |
| 160 return true; | 163 return true; |
| 161 end | 164 end |
| 162 end, 500); | 165 end, 500); |
