diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2021-12-17 15:38:11 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-17 15:38:11 (GMT) |
commit | 251d2eadc7f5b4042245709f41c38169a284e146 (patch) | |
tree | 6cd8629c5546fcca0734604cb5c7eeb03c56675f | |
parent | 87539cc716fab47cd4f501f2441c4ab8e80bce6f (diff) | |
download | cpython-251d2eadc7f5b4042245709f41c38169a284e146.zip cpython-251d2eadc7f5b4042245709f41c38169a284e146.tar.gz cpython-251d2eadc7f5b4042245709f41c38169a284e146.tar.bz2 |
bpo-46114: Fix OpenSSL version check for 3.0.1 (GH-30170)
(cherry picked from commit 2985feac4e02d590bb78bcce9e30864be53280ac)
Co-authored-by: Christian Heimes <christian@python.org>
-rw-r--r-- | .github/workflows/build.yml | 2 | ||||
-rw-r--r-- | Lib/test/test_ssl.py | 6 | ||||
-rw-r--r-- | Misc/NEWS.d/next/Tests/2021-12-17-14-46-19.bpo-46114.9iyZ_9.rst | 1 | ||||
-rwxr-xr-x | Tools/ssl/multissltests.py | 2 |
4 files changed, 8 insertions, 3 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c91fcc6..b85cf17 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -225,7 +225,7 @@ jobs: strategy: fail-fast: false matrix: - openssl_ver: [1.1.1l, 3.0.0] + openssl_ver: [1.1.1l, 3.0.1] env: OPENSSL_VER: ${{ matrix.openssl_ver }} MULTISSL_DIR: ${{ github.workspace }}/multissl diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index a485f7d..873db64 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -539,7 +539,11 @@ class BasicSocketTests(unittest.TestCase): self.assertLessEqual(status, 15) libressl_ver = f"LibreSSL {major:d}" - openssl_ver = f"OpenSSL {major:d}.{minor:d}.{fix:d}" + if major >= 3: + # 3.x uses 0xMNN00PP0L + openssl_ver = f"OpenSSL {major:d}.{minor:d}.{patch:d}" + else: + openssl_ver = f"OpenSSL {major:d}.{minor:d}.{fix:d}" self.assertTrue( s.startswith((openssl_ver, libressl_ver)), (s, t, hex(n)) 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 new file mode 100644 index 0000000..6878cea --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2021-12-17-14-46-19.bpo-46114.9iyZ_9.rst @@ -0,0 +1 @@ +Fix test case for OpenSSL 3.0.1 version. OpenSSL 3.0 uses ``0xMNN00PP0L``. diff --git a/Tools/ssl/multissltests.py b/Tools/ssl/multissltests.py index ba2663e..8fe5b5d 100755 --- a/Tools/ssl/multissltests.py +++ b/Tools/ssl/multissltests.py @@ -48,7 +48,7 @@ OPENSSL_OLD_VERSIONS = [ OPENSSL_RECENT_VERSIONS = [ "1.1.1l", - "3.0.0" + "3.0.1" ] LIBRESSL_OLD_VERSIONS = [ |