Software /
code /
prosody
Changeset
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 |
parents | 11579:ec4f0ec3c0d5 |
children | 11581:7e111f7147dc |
files | plugins/mod_tls.lua |
diffstat | 1 files changed, 6 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/mod_tls.lua Thu May 20 23:18:29 2021 +0200 +++ b/plugins/mod_tls.lua Fri May 21 19:04:01 2021 +0200 @@ -174,3 +174,9 @@ return true; end end); + +module:hook_tag(xmlns_starttls, "failure", function (session, stanza) -- luacheck: ignore 212/stanza + module:log("warn", "TLS negotiation with %s failed.", session.to_host); + session:close(nil, "TLS negotiation failed"); + return false; +end);