Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions Lib/test/test_ssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -877,7 +877,8 @@ def test_ciphers(self):
with self.assertRaisesRegex(ssl.SSLError, "No cipher can be selected"):
ctx.set_ciphers("^$:,;?*'dorothyx")

@unittest.skipIf(ssl.OPENSSL_VERSION_INFO < (1, 0, 2, 0, 0), 'OpenSSL too old')
@unittest.skipIf(ssl._OPENSSL_API_VERSION < (1, 0, 2, 0, 0),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hum, the test lacks hasattr () test here.

'OpenSSL too old')
def test_get_ciphers(self):
ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
ctx.set_ciphers('AESGCM')
Expand Down Expand Up @@ -3595,8 +3596,11 @@ def test_main(verbose=False):
break
else:
plat = repr(platform.platform())
print("test_ssl: testing with %r %r" %
(ssl.OPENSSL_VERSION, ssl.OPENSSL_VERSION_INFO))
print("test_ssl: testing with %r %r"
% (ssl.OPENSSL_VERSION, ssl.OPENSSL_VERSION_INFO))
# ssl._OPENSSL_API_VERSION is a CPython implementation detail
if hasattr(ssl, '_OPENSSL_API_VERSION'):
print(f" API version {ssl._OPENSSL_API_VERSION}")
print(" under %s" % plat)
print(" HAS_SNI = %r" % ssl.HAS_SNI)
print(" OP_ALL = 0x%8x" % ssl.OP_ALL)
Expand Down