diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2022-07-27 09:15:29 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-27 09:15:29 (GMT) |
commit | 131fc72700d4e2d1b946e650a7d310ea96d02d8c (patch) | |
tree | 380c845480fdde5b3a88268cf13477fc0d04ce05 | |
parent | f083adfdacfa90f90e1c1d8cb5ed0cb087f585c0 (diff) | |
download | cpython-131fc72700d4e2d1b946e650a7d310ea96d02d8c.zip cpython-131fc72700d4e2d1b946e650a7d310ea96d02d8c.tar.gz cpython-131fc72700d4e2d1b946e650a7d310ea96d02d8c.tar.bz2 |
[3.11] gh-95280: Fix test_get_ciphers on systems without RSA key exchange (GH-95282) (GH-95310)
Co-authored-by: Christian Heimes <christian@python.org>
-rw-r--r-- | Lib/test/test_ssl.py | 16 | ||||
-rw-r--r-- | Misc/NEWS.d/next/Tests/2022-07-26-15-22-19.gh-issue-95280.h8HvbP.rst | 2 |
2 files changed, 16 insertions, 2 deletions
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index b262857..3b3b869 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -1178,8 +1178,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) diff --git a/Misc/NEWS.d/next/Tests/2022-07-26-15-22-19.gh-issue-95280.h8HvbP.rst b/Misc/NEWS.d/next/Tests/2022-07-26-15-22-19.gh-issue-95280.h8HvbP.rst new file mode 100644 index 0000000..523d9d5 --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2022-07-26-15-22-19.gh-issue-95280.h8HvbP.rst @@ -0,0 +1,2 @@ +Fix problem with ``test_ssl`` ``test_get_ciphers`` on systems that require +perfect forward secrecy (PFS) ciphers. |