annotate mod_disable_tls/mod_disable_tls.lua @ 4326:f6fdefc5c6ac

mod_roster_command: Fix subscription when the "user JID" is a bare domain. Do not attempt to update the roster when the user is bare domain (e.g. a component), since they don't have rosters and the attempt results in an error: $ prosodyctl mod_roster_command subscribe proxy.example.com contact@example.com xxxxxxxxxxFailed to execute command: Error: /usr/lib/prosody/core/rostermanager.lua:104: attempt to concatenate local 'username' (a nil value) stack traceback: /usr/lib/prosody/core/rostermanager.lua:104: in function 'load_roster' /usr/lib/prosody/core/rostermanager.lua:305: in function 'set_contact_pending_out' mod_roster_command.lua:44: in function 'subscribe'
author Boris Grozev <boris@jitsi.org>
date Tue, 05 Jan 2021 13:15:00 -0600
parents 25be5fde250f
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1482
25be5fde250f mod_disable_tls: Default to empty set if disable_tls_ports not present in config (fixes traceback)
Matthew Wild <mwild1@gmail.com>
parents: 1481
diff changeset
1 local disable_tls_ports = module:get_option_set("disable_tls_ports", {});
1481
e10e74583b5f mod_disable_tls: New module to disable c2s TLS by port number
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
2
e10e74583b5f mod_disable_tls: New module to disable c2s TLS by port number
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
3 module:hook("stream-features", function (event)
e10e74583b5f mod_disable_tls: New module to disable c2s TLS by port number
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
4 if disable_tls_ports:contains(event.origin.conn:serverport()) then
e10e74583b5f mod_disable_tls: New module to disable c2s TLS by port number
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
5 module:log("error", "Disabling TLS for client on port %d", event.origin.conn:serverport());
e10e74583b5f mod_disable_tls: New module to disable c2s TLS by port number
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
6 event.origin.conn.starttls = false;
e10e74583b5f mod_disable_tls: New module to disable c2s TLS by port number
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
7 end
e10e74583b5f mod_disable_tls: New module to disable c2s TLS by port number
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
8 end, 1000);