cpython: 004743d210e4 (original) (raw)
--- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -208,13 +208,21 @@ class BasicSocketTests(unittest.TestCase (('emailAddress', 'python-dev@python.org'),)) self.assertEqual(p['subject'], subject) self.assertEqual(p['issuer'], subject)
self.assertEqual(p['subjectAltName'],[](#l1.7)
(('DNS', 'altnull.python.org\x00example.com'),[](#l1.8)
('email', 'null@python.org\x00user@example.org'),[](#l1.9)
('URI', 'http://null.python.org\x00http://example.org'),[](#l1.10)
('IP Address', '192.0.2.1'),[](#l1.11)
('IP Address', '2001:DB8:0:0:0:0:0:1\n'))[](#l1.12)
)[](#l1.13)
if ssl._OPENSSL_API_VERSION >= (0, 9, 8):[](#l1.14)
san = (('DNS', 'altnull.python.org\x00example.com'),[](#l1.15)
('email', 'null@python.org\x00user@example.org'),[](#l1.16)
('URI', 'http://null.python.org\x00http://example.org'),[](#l1.17)
('IP Address', '192.0.2.1'),[](#l1.18)
('IP Address', '2001:DB8:0:0:0:0:0:1\n'))[](#l1.19)
else:[](#l1.20)
# OpenSSL 0.9.7 doesn't support IPv6 addresses in subjectAltName[](#l1.21)
san = (('DNS', 'altnull.python.org\x00example.com'),[](#l1.22)
('email', 'null@python.org\x00user@example.org'),[](#l1.23)
('URI', 'http://null.python.org\x00http://example.org'),[](#l1.24)
('IP Address', '192.0.2.1'),[](#l1.25)
('IP Address', '<invalid>'))[](#l1.26)
self.assertEqual(p['subjectAltName'], san)[](#l1.28)
def test_DER_to_PEM(self): with open(SVN_PYTHON_ORG_ROOT_CERT, 'r') as f: