Skip to content

Commit bde2985

Browse files
committed
Python 2.6's ssl module has neither OPENSSL_VERSION_INFO nor _OPENSSL_API_VERSION
1 parent 8f65ef8 commit bde2985

File tree

1 file changed

+6
-15
lines changed

1 file changed

+6
-15
lines changed

Lib/test/test_ssl.py

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -102,21 +102,12 @@ def test_parse_cert_CVE_2013_4073(self):
102102
(('emailAddress', 'python-dev@python.org'),))
103103
self.assertEqual(p['subject'], subject)
104104
self.assertEqual(p['issuer'], subject)
105-
if ssl._OPENSSL_API_VERSION >= (0, 9, 8):
106-
san = (('DNS', 'altnull.python.org\x00example.com'),
107-
('email', 'null@python.org\x00user@example.org'),
108-
('URI', 'http://null.python.org\x00http://example.org'),
109-
('IP Address', '192.0.2.1'),
110-
('IP Address', '2001:DB8:0:0:0:0:0:1\n'))
111-
else:
112-
# OpenSSL 0.9.7 doesn't support IPv6 addresses in subjectAltName
113-
san = (('DNS', 'altnull.python.org\x00example.com'),
114-
('email', 'null@python.org\x00user@example.org'),
115-
('URI', 'http://null.python.org\x00http://example.org'),
116-
('IP Address', '192.0.2.1'),
117-
('IP Address', '<invalid>'))
118-
119-
self.assertEqual(p['subjectAltName'], san)
105+
san = (('DNS', 'altnull.python.org\x00example.com'),
106+
('email', 'null@python.org\x00user@example.org'),
107+
('URI', 'http://null.python.org\x00http://example.org'),
108+
('IP Address', '192.0.2.1'))
109+
110+
self.assertEqual(p['subjectAltName'][:4], san)
120111

121112
def test_DER_to_PEM(self):
122113
with open(SVN_PYTHON_ORG_ROOT_CERT, 'r') as f:

0 commit comments

Comments
 (0)