Repository: qpid-proton
Updated Branches:
  refs/heads/master 6243919fd -> 1f7ccdd55


PROTON-1233: Add python SSL test for null hostname failure


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

Branch: refs/heads/master
Commit: 1f7ccdd551b344a5a67dfdee3840e16d10990577
Parents: 6243919
Author: Clifford Jansen <[email protected]>
Authored: Mon Jun 13 10:46:14 2016 -0700
Committer: Clifford Jansen <[email protected]>
Committed: Mon Jun 13 10:46:14 2016 -0700

----------------------------------------------------------------------
 tests/python/proton_tests/ssl.py | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/1f7ccdd5/tests/python/proton_tests/ssl.py
----------------------------------------------------------------------
diff --git a/tests/python/proton_tests/ssl.py b/tests/python/proton_tests/ssl.py
index 03d1713..89fe828 100644
--- a/tests/python/proton_tests/ssl.py
+++ b/tests/python/proton_tests/ssl.py
@@ -808,6 +808,30 @@ class SslTest(common.Test):
         del server
         self.tearDown()
 
+    def test_server_hostname_authentication_2(self):
+        """Initially separated from test_server_hostname_authentication
+        above to force Windows checking and sidestep PROTON-1057 exclusion.
+        """
+
+        # Fail for a null peer name.
+        
self.server_domain.set_credentials(self._testpath("server-wc-certificate.pem"),
+                                    
self._testpath("server-wc-private-key.pem"),
+                                    "server-password")
+        
self.client_domain.set_trusted_ca_db(self._testpath("ca-certificate.pem"))
+        self.client_domain.set_peer_authentication( SSLDomain.VERIFY_PEER_NAME 
)
+
+        server = SslTest.SslTestConnection( self.server_domain, 
mode=Transport.SERVER )
+        client = SslTest.SslTestConnection( self.client_domain )
+
+        # Next line results in an eventual 
pn_ssl_set_peer_hostname(client.ssl._ssl, None)
+        client.ssl.peer_hostname = None
+        self._do_handshake( client, server )
+        assert client.transport.closed
+        assert server.transport.closed
+        assert client.connection.state & Endpoint.REMOTE_UNINIT
+        assert server.connection.state & Endpoint.REMOTE_UNINIT
+        self.tearDown()
+
     def test_defaults_messenger_app(self):
         """ Test an SSL connection using the Messenger apps (no certificates)
         """


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

Reply via email to