summaryrefslogtreecommitdiff
path: root/src/connection.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2014-02-13 00:48:19 +0100
committermathieui <mathieui@mathieui.net>2014-02-13 00:48:19 +0100
commit7e3efccb537ae11e9550ddf14ea6ca4ba472804a (patch)
tree1d8dcd3a3ff9e4ff77fe31b305dba5a54fc4fedf /src/connection.py
parentf43f06214ef5bb16de616feb754fcdb56a208192 (diff)
downloadpoezio-7e3efccb537ae11e9550ddf14ea6ca4ba472804a.tar.gz
poezio-7e3efccb537ae11e9550ddf14ea6ca4ba472804a.tar.bz2
poezio-7e3efccb537ae11e9550ddf14ea6ca4ba472804a.tar.xz
poezio-7e3efccb537ae11e9550ddf14ea6ca4ba472804a.zip
Fix #2407 (unencrypted connections)
Add a force_encryption option set to true by default.
Diffstat (limited to 'src/connection.py')
-rw-r--r--src/connection.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/connection.py b/src/connection.py
index 37385650..b60f3b71 100644
--- a/src/connection.py
+++ b/src/connection.py
@@ -50,6 +50,13 @@ class Connection(sleekxmpp.ClientXMPP):
# TODO: use the system language
sleekxmpp.ClientXMPP.__init__(self, jid, password, lang=config.get('lang', 'en'))
+ force_encryption = config.get('force_encryption', 'true').lower() != 'false'
+ if force_encryption:
+ self['feature_mechanisms'].unencrypted_plain = False
+ self['feature_mechanisms'].unencrypted_digest = False
+ self['feature_mechanisms'].unencrypted_cram = False
+ self['feature_mechanisms'].unencrypted_scram = False
+
self.core = None
self.auto_reconnect = True if config.get('auto_reconnect', 'false').lower() in ('true', '1') else False
self.reconnect_max_attempts = 0