Commit 765fdf61 authored by fedor.brunner's avatar fedor.brunner
Browse files

BOSH doesn't support channel binding.

BOSH (XEP-0124) uses short lived HTTPS connections for encryption.
Channel binding requires long lived TLS connection, therefor
doesn't work with XMPP over BOSH.

Fixes #22
parent 13598441
......@@ -495,6 +495,7 @@ class NonBlockingClient:
self._channel_binding = None
if self.connected in ('ssl', 'tls'):
if self.protocol_type != 'BOSH':
self._channel_binding = self.Connection.NonBlockingTLS.get_channel_binding()
# TLS handshake is finished so channel binding data muss exist
assert (self._channel_binding != None)
......@@ -509,6 +509,9 @@ class NonBlockingTLS(PlugIn):
sslObj = self._owner._sslObj
return sslObj.get_finished()
return sslObj.get_channel_binding()
except AttributeError:
raise NotImplementedError
......@@ -555,7 +555,7 @@ class NonBlockingTCP(NonBlockingTransport, IdleObject):
return None
self.sendbuff = self.sendqueue.pop(0)
send_count = self._send(self.sendbuff)
send_count = self._send(self.sendbuff.encode("utf-8"))
if send_count:
sent_data = self.sendbuff[:send_count]
self.sendbuff = self.sendbuff[send_count:]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment