You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by kg...@apache.org on 2016/03/09 22:21:13 UTC
qpid-proton git commit: PROTON-1157: fail if amqps: scheme is
specified but SSL is not available
Repository: qpid-proton
Updated Branches:
refs/heads/master 747ee1721 -> a0585851e
PROTON-1157: fail if amqps: scheme is specified but SSL is not available
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/a0585851
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/a0585851
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/a0585851
Branch: refs/heads/master
Commit: a0585851e1e8ed9678496e38278f4a7554d03636
Parents: 747ee17
Author: Ken Giusti <kg...@apache.org>
Authored: Wed Mar 9 15:53:06 2016 -0500
Committer: Ken Giusti <kg...@apache.org>
Committed: Wed Mar 9 16:21:02 2016 -0500
----------------------------------------------------------------------
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/a0585851/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 207690e..cda6248 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
@@ -693,6 +695,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()
@@ -821,8 +825,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: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org