summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2011-03-22 12:08:27 -0400
committerLance Stout <lancestout@gmail.com>2011-03-22 12:08:27 -0400
commita9685a00b304aa136ffd0681ed3b92126e05ecae (patch)
tree2f51c7cde0e2314c6ef63686f7fdb4f1bfcc06a3
parentaf45b51f4fe32b37e80e51dea66b9fd0ca3d8ad2 (diff)
parent86a6b40fd81daa7d0e976dbc63f33544060c75d1 (diff)
downloadslixmpp-a9685a00b304aa136ffd0681ed3b92126e05ecae.tar.gz
slixmpp-a9685a00b304aa136ffd0681ed3b92126e05ecae.tar.bz2
slixmpp-a9685a00b304aa136ffd0681ed3b92126e05ecae.tar.xz
slixmpp-a9685a00b304aa136ffd0681ed3b92126e05ecae.zip
Merge branch 'develop' into stream_features
Conflicts: sleekxmpp/clientxmpp.py
-rw-r--r--sleekxmpp/clientxmpp.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/sleekxmpp/clientxmpp.py b/sleekxmpp/clientxmpp.py
index 85a77d7c..d5e985d2 100644
--- a/sleekxmpp/clientxmpp.py
+++ b/sleekxmpp/clientxmpp.py
@@ -137,7 +137,7 @@ class ClientXMPP(BaseXMPP):
self._handle_sasl_plain,
priority=0)
- def connect(self, address=tuple(), reattempt=True):
+ def connect(self, address=tuple(), reattempt=True, use_tls=True):
"""
Connect to the XMPP server.
@@ -148,7 +148,9 @@ class ClientXMPP(BaseXMPP):
Arguments:
address -- A tuple containing the server's host and port.
reattempt -- If True, reattempt the connection if an
- error occurs.
+ error occurs. Defaults to True.
+ use_tls -- Indicates if TLS should be used for the
+ connection. Defaults to True.
"""
self.session_started_event.clear()
if not address or len(address) < 2:
@@ -193,7 +195,7 @@ class ClientXMPP(BaseXMPP):
address = (self.boundjid.host, 5222)
return XMLStream.connect(self, address[0], address[1],
- use_tls=True, reattempt=reattempt)
+ use_tls=use_tls, reattempt=reattempt)
def register_feature(self, name, handler, restart=False, order=5000):
"""
@@ -327,7 +329,9 @@ class ClientXMPP(BaseXMPP):
self.features.append('starttls')
raise RestartStream()
- if self.ssl_support:
+ if not self.use_tls:
+ return False
+ elif self.ssl_support:
self.register_handler(
Callback('STARTTLS Proceed',
MatchXPath(tls.Proceed.tag_name()),