NO-JIRA: fail if amqps: scheme is specified but SSL is not available
(cherry picked from commit a0585851e1e8ed9678496e38278f4a7554d03636)
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 @@
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 @@
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 @@
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