diff options
author | Christian Heimes <christian@cheimes.de> | 2013-08-25 12:12:50 (GMT) |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2013-08-25 12:12:50 (GMT) |
commit | 2769d44827055b9cf1190e6d08dc1625fef65e3c (patch) | |
tree | 4aeca0234330050e33464e984cf145826670df02 /Lib/test | |
parent | 59390279699f5c3c3367f914dfe954d703c62b95 (diff) | |
parent | 157c9834b40ab202caa650735435410f9225df12 (diff) | |
download | cpython-2769d44827055b9cf1190e6d08dc1625fef65e3c.zip cpython-2769d44827055b9cf1190e6d08dc1625fef65e3c.tar.gz cpython-2769d44827055b9cf1190e6d08dc1625fef65e3c.tar.bz2 |
Issue #18709: Fix issue with IPv6 address in subjectAltName on Mac OS X Tiger
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_ssl.py | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index 6a99ad0..8915305 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -222,13 +222,21 @@ class BasicSocketTests(unittest.TestCase): (('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', '<invalid>')) + + self.assertEqual(p['subjectAltName'], san) def test_DER_to_PEM(self): with open(SVN_PYTHON_ORG_ROOT_CERT, 'r') as f: |