summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorBill Janssen <janssen@parc.com>2007-09-05 00:46:27 (GMT)
committerBill Janssen <janssen@parc.com>2007-09-05 00:46:27 (GMT)
commitffe576dc78cbdfb5f5e5625fa0a54ca1ce7b3bdc (patch)
tree4ac022f14e17811366b66a9c61c8cfa148beb905 /Lib
parent38336406ebdbe5d524f29483b3c2c3d47d1d76af (diff)
downloadcpython-ffe576dc78cbdfb5f5e5625fa0a54ca1ce7b3bdc.zip
cpython-ffe576dc78cbdfb5f5e5625fa0a54ca1ce7b3bdc.tar.gz
cpython-ffe576dc78cbdfb5f5e5625fa0a54ca1ce7b3bdc.tar.bz2
SSL certificate distinguished names should be represented by tuples
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_ssl.py13
1 files changed, 5 insertions, 8 deletions
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
index 35c6af9..04daab2 100644
--- a/Lib/test/test_ssl.py
+++ b/Lib/test/test_ssl.py
@@ -137,18 +137,15 @@ class ConnectedTests(unittest.TestCase):
cert = c2.getpeercert()
if not cert:
raise test_support.TestFailed("Can't get peer certificate.")
+ if test_support.verbose:
+ sys.stdout.write(pprint.pformat(cert) + '\n')
if not cert.has_key('subject'):
raise test_support.TestFailed(
"No subject field in certificate: %s." %
pprint.pformat(cert))
- if not (cert['subject'].has_key('organizationName')):
- raise test_support.TestFailed(
- "No 'organizationName' field in certificate subject: %s." %
- pprint.pformat(cert))
- if (cert['subject']['organizationName'] !=
- "Python Software Foundation"):
+ if not ('organizationName', 'Python Software Foundation') in cert['subject']:
raise test_support.TestFailed(
- "Invalid 'organizationName' field in certificate subject; "
+ "Missing or invalid 'organizationName' field in certificate subject; "
"should be 'Python Software Foundation'.");
c2.close()
@@ -336,7 +333,7 @@ def create_cert_files(hostname=None):
def test_main(verbose=False):
if skip_expected:
- raise test_support.TestSkipped("socket module has no ssl support")
+ raise test_support.TestSkipped("No SSL support")
global CERTFILE
CERTFILE = os.path.join(os.path.dirname(__file__) or os.curdir,