Software / code / prosody
Comparison
plugins/mod_tls.lua @ 11580:9ad5ec65132d
mod_tls: Add "support" for <failure> by closing gracefully
Nicer than the "unsupported stanza type" error we get otherwise.
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Fri, 21 May 2021 19:04:01 +0200 |
| parent | 11530:a90389e7296c |
| child | 11727:f3aee8a825cc |
comparison
equal
deleted
inserted
replaced
| 11579:ec4f0ec3c0d5 | 11580:9ad5ec65132d |
|---|---|
| 172 session.conn:starttls(session.ssl_ctx); | 172 session.conn:starttls(session.ssl_ctx); |
| 173 session.secure = false; | 173 session.secure = false; |
| 174 return true; | 174 return true; |
| 175 end | 175 end |
| 176 end); | 176 end); |
| 177 | |
| 178 module:hook_tag(xmlns_starttls, "failure", function (session, stanza) -- luacheck: ignore 212/stanza | |
| 179 module:log("warn", "TLS negotiation with %s failed.", session.to_host); | |
| 180 session:close(nil, "TLS negotiation failed"); | |
| 181 return false; | |
| 182 end); |