Repository: qpid-proton
Updated Branches:
  refs/heads/0.12.x f438f83d3 -> 6e24d4b23


NO-JIRA: fail if amqps: scheme is specified but SSL is not available

(cherry picked from commit a0585851e1e8ed9678496e38278f4a7554d03636)


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/6e24d4b2
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/6e24d4b2
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/6e24d4b2

Branch: refs/heads/0.12.x
Commit: 6e24d4b238ce1b93d9f4c0d4f95abf8057222c2e
Parents: f438f83
Author: Ken Giusti <[email protected]>
Authored: Wed Mar 9 15:53:06 2016 -0500
Committer: Ken Giusti <[email protected]>
Committed: Thu Mar 17 11:45:49 2016 -0400

----------------------------------------------------------------------
 proton-c/bindings/python/proton/reactor.py | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/6e24d4b2/proton-c/bindings/python/proton/reactor.py
----------------------------------------------------------------------
diff --git a/proton-c/bindings/python/proton/reactor.py 
b/proton-c/bindings/python/proton/reactor.py
index 195ff28..dea9ad8 100644
--- a/proton-c/bindings/python/proton/reactor.py
+++ b/proton-c/bindings/python/proton/reactor.py
@@ -526,7 +526,9 @@ class Connector(Handler):
         transport.bind(connection)
         if self.heartbeat:
             transport.idle_timeout = self.heartbeat
-        if url.scheme == 'amqps' and self.ssl_domain:
+        if url.scheme == 'amqps':
+            if not self.ssl_domain:
+                raise SSLUnavailable("amqps: SSL libraries not found")
             self.ssl = SSL(transport, self.ssl_domain)
             self.ssl.peer_hostname = url.host
 
@@ -689,6 +691,8 @@ class Container(Reactor):
             connector.reconnect = reconnect
         elif reconnect is None:
             connector.reconnect = Backoff()
+        # use container's default client domain if none specified.  This is
+        # only necessary of the URL specifies the "amqps:" scheme
         connector.ssl_domain = ssl_domain or (self.ssl and self.ssl.client)
         conn._session_policy = SessionPerConnection() #todo: make configurable
         conn.open()
@@ -817,8 +821,12 @@ class Container(Reactor):
         url = Url(url)
         acceptor = self.acceptor(url.host, url.port)
         ssl_config = ssl_domain
-        if not ssl_config and url.scheme == 'amqps' and self.ssl:
-            ssl_config = self.ssl.server
+        if not ssl_config and url.scheme == 'amqps':
+            # use container's default server domain
+            if self.ssl:
+                ssl_config = self.ssl.server
+            else:
+                raise SSLUnavailable("amqps: SSL libraries not found")
         if ssl_config:
             acceptor.set_ssl_domain(ssl_config)
         return acceptor


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to