Mercurial > prosody-modules
comparison mod_s2s_never_encrypt_blacklist/mod_s2s_never_encrypt_blacklist.lua @ 413:e4d33cdfed21
mod_s2s_never_encrypt_blacklist: filter both incoming and outgoing streams.
author | Marco Cirillo <maranda@lightwitch.org> |
---|---|
date | Fri, 02 Sep 2011 23:35:25 +0000 |
parents | 8963f4026f3a |
children | 8fe1b47c9bde |
comparison
equal
deleted
inserted
replaced
412:8963f4026f3a | 413:e4d33cdfed21 |
---|---|
1 -- Filter out servers which gets choppy and buggy when it comes to starttls. | 1 -- Filter out servers which gets choppy and buggy when it comes to starttls. |
2 | 2 |
3 local bad_servers = module:get_option_set("tls_s2s_blacklist"); | 3 local bad_servers = module:get_option_set("tls_s2s_blacklist"); |
4 | 4 |
5 local function disable_tls_for_baddies(event) | 5 local function disable_tls_for_baddies_in(event) |
6 if bad_servers:contains(event.origin.to_host) then event.origin.conn.starttls = nil; end | 6 if bad_servers:contains(event.origin.to_host) then event.origin.conn.starttls = nil; end |
7 end | 7 end |
8 | 8 |
9 module:hook("stanza/http://etherx.jabber.org/streams:features", disable_tls_for_baddies, 510) | 9 local function disable_tls_for_baddies_out(event) |
10 if bad_servers:contains(event.origin.from_host) then event.origin.conn.starttls = nil; end | |
11 end | |
12 | |
13 module:hook("s2s-stream-features", disable_tls_for_baddies_out, 10) | |
14 module:hook("stanza/http://etherx.jabber.org/streams:features", disable_tls_for_baddies_in, 510) | |
15 |