aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-05-21 19:04:01 +0200
committerKim Alvefur <zash@zash.se>2021-05-21 19:04:01 +0200
commitd7b7a25e7342a1a7e99eb81e510144291189c7f3 (patch)
tree9ab2eda6279aacfddf6819101f117b5025dd0ed6
parent15d7143bb3940911a175b1f311b92a4e88c3723f (diff)
downloadprosody-d7b7a25e7342a1a7e99eb81e510144291189c7f3.tar.gz
prosody-d7b7a25e7342a1a7e99eb81e510144291189c7f3.zip
mod_tls: Add "support" for <failure> by closing gracefully
Nicer than the "unsupported stanza type" error we get otherwise.
-rw-r--r--plugins/mod_tls.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/plugins/mod_tls.lua b/plugins/mod_tls.lua
index 931701f5..39207f6f 100644
--- a/plugins/mod_tls.lua
+++ b/plugins/mod_tls.lua
@@ -174,3 +174,9 @@ module:hook_tag(xmlns_starttls, "proceed", function (session, stanza) -- luachec
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);