Skip to content
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Test case: availability
  • Loading branch information
xtkoba authored Aug 18, 2021
commit 5891371a2c4785521326d28d05640e369ea02b5c
9 changes: 9 additions & 0 deletions Lib/test/test_ssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -1192,6 +1192,9 @@ def test_options(self):
ctx.options = 0
# Ubuntu has OP_NO_SSLv3 forced on by default
self.assertEqual(0, ctx.options & ~ssl.OP_NO_SSLv3)
# 0.9.8m or later
if ssl.OPENSSL_VERSION_INFO >= (0, 9, 8, 13, 15):
self.assertNotEqual(OP_LEGACY_SERVER_CONNECT, 0)

def test_verify_mode_protocol(self):
with warnings_helper.check_warnings():
Expand Down Expand Up @@ -1682,6 +1685,12 @@ def _assert_context_options(self, ctx):
if OP_CIPHER_SERVER_PREFERENCE != 0:
self.assertEqual(ctx.options & OP_CIPHER_SERVER_PREFERENCE,
OP_CIPHER_SERVER_PREFERENCE)
if OP_LEGACY_SERVER_CONNECT != 0:
if IS_OPENSSL_3_0_0:
self.assertEqual(ctx.options & OP_LEGACY_SERVER_CONNECT, 0)
else:
self.assertEqual(ctx.options & OP_LEGACY_SERVER_CONNECT,
OP_LEGACY_SERVER_CONNECT)

def test_create_default_context(self):
ctx = ssl.create_default_context()
Expand Down