Dont allow plain BOSH by default

This commit is contained in:
Philipp Hörist 2018-04-29 23:34:46 +02:00
parent b8554e3e22
commit 56a5d01609
1 changed files with 6 additions and 3 deletions

View File

@ -1191,15 +1191,18 @@ class Connection(CommonConnection, ConnectionHandlers):
if scheme == 'https':
connection_types = ['ssl']
else:
connection_types = ['plain']
if allow_plaintext_connection:
connection_types = ['plain']
else:
connection_types = []
host = self._select_next_host(self._hosts)
self._hosts.remove(host)
# Skip record if connection type is not supported.
if host['type'] not in connection_types:
log.debug("Skipping connection record with unsupported type: %s" %
host['type'])
log.info("Skipping connection record with unsupported type: %s",
host['type'])
self._connect_to_next_host(retry)
return