]> granicus.if.org Git - python/commitdiff
Python 2.6's ssl module has neither OPENSSL_VERSION_INFO nor _OPENSSL_API_VERSION
authorChristian Heimes <christian@cheimes.de>
Tue, 3 Sep 2013 12:47:00 +0000 (14:47 +0200)
committerChristian Heimes <christian@cheimes.de>
Tue, 3 Sep 2013 12:47:00 +0000 (14:47 +0200)
Lib/test/test_ssl.py

index f779dbae2260aef767a9c18544f3ee6ded9032bd..59294b45479fc0eae68365706cd19d968c0c8c97 100644 (file)
@@ -102,21 +102,12 @@ class BasicTests(unittest.TestCase):
                    (('emailAddress', 'python-dev@python.org'),))
         self.assertEqual(p['subject'], subject)
         self.assertEqual(p['issuer'], subject)
-        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)
+        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'))
+
+        self.assertEqual(p['subjectAltName'][:4], san)
 
     def test_DER_to_PEM(self):
         with open(SVN_PYTHON_ORG_ROOT_CERT, 'r') as f: