You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by tr...@apache.org on 2016/07/11 18:10:48 UTC

qpid-dispatch git commit: DISPATCH-401 - Made qdstat and qdmanage verify peer name by default. Added new option --ssl-disable-peer-name-verify to disable peer name verification

Repository: qpid-dispatch
Updated Branches:
  refs/heads/master db85211dc -> d7dc541a4


DISPATCH-401 - Made qdstat and qdmanage verify peer name by default. Added new option --ssl-disable-peer-name-verify to disable peer name verification


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

Branch: refs/heads/master
Commit: d7dc541a4ed325548571b7aed4bbc8175dd3bf4b
Parents: db85211
Author: Ganesh Murthy <gm...@redhat.com>
Authored: Mon Jul 11 12:42:05 2016 -0400
Committer: Ganesh Murthy <gm...@redhat.com>
Committed: Mon Jul 11 12:46:49 2016 -0400

----------------------------------------------------------------------
 python/qpid_dispatch_internal/tools/command.py | 19 ++++++++++++++++---
 tests/system_tests_qdmanage.py                 |  3 ++-
 tests/system_tests_qdstat.py                   |  5 ++++-
 tests/system_tests_sasl_plain.py               |  1 +
 4 files changed, 23 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/d7dc541a/python/qpid_dispatch_internal/tools/command.py
----------------------------------------------------------------------
diff --git a/python/qpid_dispatch_internal/tools/command.py b/python/qpid_dispatch_internal/tools/command.py
index 65ef3cc..ff24123 100644
--- a/python/qpid_dispatch_internal/tools/command.py
+++ b/python/qpid_dispatch_internal/tools/command.py
@@ -96,6 +96,9 @@ def connection_options(options, title="Connection Options"):
     # Use the --sasl-password-file option to avoid having the --sasl-password in history or scripts.
     group.add_option("--sasl-password-file", action="store", type="string", metavar="SASL-PASSWORD-FILE",
                      help="Password for SASL plain authentication")
+    group.add_option("--ssl-disable-peer-name-verify", action="store_true", default=False,
+                     help="Disables SSL peer name verification. WARNING - This option is insecure and must not be used "
+                          "in production environments")
 
     return group
 
@@ -139,8 +142,13 @@ def opts_ssl_domain(opts, mode=SSLDomain.MODE_CLIENT):
     """Return proton.SSLDomain from command line options or None if no SSL options specified.
     @param opts: Parsed optoins including connection_options()
     """
-    certificate, key, trustfile, password, password_file = opts.ssl_certificate, opts.ssl_key, opts.ssl_trustfile, \
-                                                           opts.ssl_password, opts.ssl_password_file
+
+    certificate, key, trustfile, password, password_file, ssl_disable_peer_name_verify = opts.ssl_certificate,\
+                                                                                         opts.ssl_key,\
+                                                                                         opts.ssl_trustfile,\
+                                                                                         opts.ssl_password,\
+                                                                                         opts.ssl_password_file, \
+                                                                                         opts.ssl_disable_peer_name_verify
 
     if not (certificate or trustfile):
         return None
@@ -149,9 +157,14 @@ def opts_ssl_domain(opts, mode=SSLDomain.MODE_CLIENT):
         password = get_password(password_file)
 
     domain = SSLDomain(mode)
+
     if trustfile:
         domain.set_trusted_ca_db(str(trustfile))
-        domain.set_peer_authentication(SSLDomain.VERIFY_PEER, str(trustfile))
+        if ssl_disable_peer_name_verify:
+            domain.set_peer_authentication(SSLDomain.VERIFY_PEER, str(trustfile))
+        else:
+            domain.set_peer_authentication(SSLDomain.VERIFY_PEER_NAME, str(trustfile))
+
     if certificate:
         domain.set_credentials(str(certificate), str(key), str(password))
     return domain

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/d7dc541a/tests/system_tests_qdmanage.py
----------------------------------------------------------------------
diff --git a/tests/system_tests_qdmanage.py b/tests/system_tests_qdmanage.py
index 753507c..adcbe66 100644
--- a/tests/system_tests_qdmanage.py
+++ b/tests/system_tests_qdmanage.py
@@ -328,7 +328,8 @@ class QdmanageTestSsl(QdmanageTest):
                                              '--ssl-certificate=' + self.ssl_file('client-certificate.pem'),
                                              '--ssl-key=' + self.ssl_file('client-private-key.pem'),
                                              '--ssl-password=client-password',
-                                             '--timeout', str(TIMEOUT)],
+                                             '--timeout', str(TIMEOUT),
+                                             '--ssl-disable-peer-name-verify'],
             stdin=PIPE, stdout=PIPE, stderr=STDOUT, expect=expect)
         out = p.communicate(input)[0]
         try:

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/d7dc541a/tests/system_tests_qdstat.py
----------------------------------------------------------------------
diff --git a/tests/system_tests_qdstat.py b/tests/system_tests_qdstat.py
index ead0b0d..45b5ab6 100644
--- a/tests/system_tests_qdstat.py
+++ b/tests/system_tests_qdstat.py
@@ -39,6 +39,7 @@ class QdstatTest(system_test.TestCase):
         p = self.popen(
             ['qdstat', '--bus', str(address or self.router.addresses[0]), '--timeout', str(system_test.TIMEOUT) ] + args,
             name='qdstat-'+self.id(), stdout=PIPE, expect=None)
+
         out = p.communicate()[0]
         assert p.returncode == 0, \
             "qdstat exit status %s, output:\n%s" % (p.returncode, out)
@@ -114,8 +115,10 @@ try:
 
         def run_qdstat(self, args, regexp=None, address=None):
             p = self.popen(
-                ['qdstat', '--bus', str(address or self.router.addresses[0]), '--timeout', str(system_test.TIMEOUT) ] + args,
+                ['qdstat', '--bus', str(address or self.router.addresses[0]), '--ssl-disable-peer-name-verify',
+                 '--timeout', str(system_test.TIMEOUT) ] + args,
                 name='qdstat-'+self.id(), stdout=PIPE, expect=None)
+
             out = p.communicate()[0]
             assert p.returncode == 0, \
                 "qdstat exit status %s, output:\n%s" % (p.returncode, out)

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/d7dc541a/tests/system_tests_sasl_plain.py
----------------------------------------------------------------------
diff --git a/tests/system_tests_sasl_plain.py b/tests/system_tests_sasl_plain.py
index e09c69b..7da5ca7 100644
--- a/tests/system_tests_sasl_plain.py
+++ b/tests/system_tests_sasl_plain.py
@@ -258,6 +258,7 @@ class RouterTestPlainSaslOverSsl(RouterTestPlainSaslCommon):
              '--sasl-username=test@domain.com',
              '--sasl-password=password',
              # The following are SSL args
+             '--ssl-disable-peer-name-verify',
              '--ssl-trustfile=' + self.ssl_file('ca-certificate.pem'),
              '--ssl-certificate=' + self.ssl_file('client-certificate.pem'),
              '--ssl-key=' + self.ssl_file('client-private-key.pem'),


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