1 Upstream-Status: Backport
2 Signed-off-by: Ross Burton <ross.burton@arm.com>
4 From 251d2eadc7f5b4042245709f41c38169a284e146 Mon Sep 17 00:00:00 2001
5 From: "Miss Islington (bot)"
6 <31488909+miss-islington@users.noreply.github.com>
7 Date: Fri, 17 Dec 2021 07:38:11 -0800
8 Subject: [PATCH] bpo-46114: Fix OpenSSL version check for 3.0.1 (GH-30170)
10 (cherry picked from commit 2985feac4e02d590bb78bcce9e30864be53280ac)
12 Co-authored-by: Christian Heimes <christian@python.org>
14 .github/workflows/build.yml | 2 +-
15 Lib/test/test_ssl.py | 6 +++++-
16 .../next/Tests/2021-12-17-14-46-19.bpo-46114.9iyZ_9.rst | 1 +
17 Tools/ssl/multissltests.py | 2 +-
18 4 files changed, 8 insertions(+), 3 deletions(-)
19 create mode 100644 Misc/NEWS.d/next/Tests/2021-12-17-14-46-19.bpo-46114.9iyZ_9.rst
21 diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
22 index a485f7d4c3..873db6403d 100644
23 --- a/Lib/test/test_ssl.py
24 +++ b/Lib/test/test_ssl.py
25 @@ -539,7 +539,11 @@ def test_openssl_version(self):
26 self.assertLessEqual(status, 15)
28 libressl_ver = f"LibreSSL {major:d}"
29 - openssl_ver = f"OpenSSL {major:d}.{minor:d}.{fix:d}"
31 + # 3.x uses 0xMNN00PP0L
32 + openssl_ver = f"OpenSSL {major:d}.{minor:d}.{patch:d}"
34 + openssl_ver = f"OpenSSL {major:d}.{minor:d}.{fix:d}"
36 s.startswith((openssl_ver, libressl_ver)),
38 diff --git a/Misc/NEWS.d/next/Tests/2021-12-17-14-46-19.bpo-46114.9iyZ_9.rst b/Misc/NEWS.d/next/Tests/2021-12-17-14-46-19.bpo-46114.9iyZ_9.rst
40 index 0000000000..6878cea032
42 +++ b/Misc/NEWS.d/next/Tests/2021-12-17-14-46-19.bpo-46114.9iyZ_9.rst
44 +Fix test case for OpenSSL 3.0.1 version. OpenSSL 3.0 uses ``0xMNN00PP0L``.
45 diff --git a/Tools/ssl/multissltests.py b/Tools/ssl/multissltests.py
46 index ba2663e9a3..8fe5b5d0c2 100755
47 --- a/Tools/ssl/multissltests.py
48 +++ b/Tools/ssl/multissltests.py
51 OPENSSL_RECENT_VERSIONS = [
57 LIBRESSL_OLD_VERSIONS = [