mirror of
https://github.com/python/cpython.git
synced 2025-07-23 11:15:24 +00:00
gh-95280: Fix test_get_ciphers on systems without RSA key exchange (GH-95282)
(cherry picked from commit 565403038b
)
Co-authored-by: Christian Heimes <christian@python.org>
This commit is contained in:
parent
321b8bbf0f
commit
b77c403ed5
2 changed files with 16 additions and 2 deletions
|
@ -1177,8 +1177,20 @@ class ContextTests(unittest.TestCase):
|
|||
ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
|
||||
ctx.set_ciphers('AESGCM')
|
||||
names = set(d['name'] for d in ctx.get_ciphers())
|
||||
self.assertIn('AES256-GCM-SHA384', names)
|
||||
self.assertIn('AES128-GCM-SHA256', names)
|
||||
expected = {
|
||||
'AES128-GCM-SHA256',
|
||||
'ECDHE-ECDSA-AES128-GCM-SHA256',
|
||||
'ECDHE-RSA-AES128-GCM-SHA256',
|
||||
'DHE-RSA-AES128-GCM-SHA256',
|
||||
'AES256-GCM-SHA384',
|
||||
'ECDHE-ECDSA-AES256-GCM-SHA384',
|
||||
'ECDHE-RSA-AES256-GCM-SHA384',
|
||||
'DHE-RSA-AES256-GCM-SHA384',
|
||||
}
|
||||
intersection = names.intersection(expected)
|
||||
self.assertGreaterEqual(
|
||||
len(intersection), 2, f"\ngot: {sorted(names)}\nexpected: {sorted(expected)}"
|
||||
)
|
||||
|
||||
def test_options(self):
|
||||
ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue