summaryrefslogtreecommitdiff
path: root/python/qpid/framer.py
diff options
context:
space:
mode:
authorTed Ross <tross@apache.org>2012-07-26 14:38:53 +0000
committerTed Ross <tross@apache.org>2012-07-26 14:38:53 +0000
commitf37e96a40605ec79edd8d46c1934487578b6682e (patch)
treea9948eef3f9cfcffac5a980e2413b998e198a98c /python/qpid/framer.py
parent4e3569802ff6e43836de96e0de569e8fda0b0b5a (diff)
downloadqpid-python-f37e96a40605ec79edd8d46c1934487578b6682e.tar.gz
QPID-3175 - Added SSL/x.509-auth capability to Python clients and Python tools
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1366020 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python/qpid/framer.py')
-rw-r--r--python/qpid/framer.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/python/qpid/framer.py b/python/qpid/framer.py
index 47f57cf649..8e4ef014f1 100644
--- a/python/qpid/framer.py
+++ b/python/qpid/framer.py
@@ -51,9 +51,10 @@ class Framer(Packer):
self.sock_lock.acquire()
try:
if self.security_layer_tx:
- status, cipher_buf = self.security_layer_tx.encode(self.tx_buf)
- if status == False:
- raise Closed(self.security_layer_tx.getError())
+ try:
+ cipher_buf = self.security_layer_tx.encode(self.tx_buf)
+ except SASLError, e:
+ raise Closed(str(e))
self._write(cipher_buf)
else:
self._write(self.tx_buf)
@@ -91,9 +92,10 @@ class Framer(Packer):
try:
s = self.sock.recv(n) # NOTE: instead of "n", arg should be "self.maxbufsize"
if self.security_layer_rx:
- status, s = self.security_layer_rx.decode(s)
- if status == False:
- raise Closed(self.security_layer_tx.getError())
+ try:
+ s = self.security_layer_rx.decode(s)
+ except SASLError, e:
+ raise Closed(str(e))
except socket.timeout:
if self.aborted():
raise Closed()