(original) (raw)

changeset: 85374:004743d210e4 branch: 3.3 parent: 85368:1589203ff116 user: Christian Heimes christian@cheimes.de date: Sun Aug 25 14:12:41 2013 +0200 files: Lib/test/test_ssl.py description: Issue #18709: Fix issue with IPv6 address in subjectAltName on Mac OS X Tiger diff -r 1589203ff116 -r 004743d210e4 Lib/test/test_ssl.py --- a/Lib/test/test_ssl.py Sat Aug 24 15:15:19 2013 -0500 +++ b/Lib/test/test_ssl.py Sun Aug 25 14:12:41 2013 +0200 @@ -208,13 +208,21 @@ (('emailAddress', 'python-dev@python.org'),)) self.assertEqual(p['subject'], subject) self.assertEqual(p['issuer'], subject) - self.assertEqual(p['subjectAltName'], - (('DNS', 'altnull.python.org\x00example.com'), - ('email', 'null@python.org\x00user@example.org'), - ('URI', 'http://null.python.org\\x00http://example.org'), - ('IP Address', '192.0.2.1'), - ('IP Address', '2001:DB8:0:0:0:0:0:1\n')) - ) + if ssl._OPENSSL_API_VERSION >= (0, 9, 8): + san = (('DNS', 'altnull.python.org\x00example.com'), + ('email', 'null@python.org\x00user@example.org'), + ('URI', 'http://null.python.org\\x00http://example.org'), + ('IP Address', '192.0.2.1'), + ('IP Address', '2001:DB8:0:0:0:0:0:1\n')) + else: + # OpenSSL 0.9.7 doesn't support IPv6 addresses in subjectAltName + san = (('DNS', 'altnull.python.org\x00example.com'), + ('email', 'null@python.org\x00user@example.org'), + ('URI', 'http://null.python.org\\x00http://example.org'), + ('IP Address', '192.0.2.1'), + ('IP Address', '')) + + self.assertEqual(p['subjectAltName'], san) def test_DER_to_PEM(self): with open(SVN_PYTHON_ORG_ROOT_CERT, 'r') as f:/christian@cheimes.de