You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ac...@apache.org on 2017/01/03 22:02:34 UTC

[02/30] qpid-proton git commit: PROTON-1355: add ability to control sni directly as well

PROTON-1355: add ability to control sni directly as well


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

Branch: refs/heads/go1
Commit: b47ebb7e4473e1efd5ee6c735b17ca0595e48184
Parents: 7d404b6
Author: Gordon Sim <gs...@redhat.com>
Authored: Fri Nov 18 13:50:36 2016 +0000
Committer: Gordon Sim <gs...@redhat.com>
Committed: Wed Nov 30 20:49:13 2016 +0000

----------------------------------------------------------------------
 proton-c/bindings/python/proton/reactor.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/b47ebb7e/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 3562aa9..e4dab95 100644
--- a/proton-c/bindings/python/proton/reactor.py
+++ b/proton-c/bindings/python/proton/reactor.py
@@ -534,6 +534,7 @@ class Connector(Handler):
         self.user = None
         self.password = None
         self.virtual_host = None
+        self.ssl_sni = None
 
     def _connect(self, connection, reactor):
         assert(reactor is not None)
@@ -565,7 +566,7 @@ class Connector(Handler):
             if not self.ssl_domain:
                 raise SSLUnavailable("amqps: SSL libraries not found")
             self.ssl = SSL(transport, self.ssl_domain)
-            self.ssl.peer_hostname = self.virtual_host if self.virtual_host != None else url.host
+            self.ssl.peer_hostname = self.ssl_sni or self.virtual_host or url.host
 
     def on_connection_local_open(self, event):
         self._connect(event.connection, event.reactor)
@@ -724,6 +725,7 @@ class Container(Reactor):
         if connector.virtual_host:
             # only set hostname if virtual-host is a non-empty string
             conn.hostname = connector.virtual_host
+        connector.ssl_sni = kwargs.get('sni')
 
         conn._overrides = connector
         if url: connector.address = Urls([url])


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org