From fc9602819181d68568259029a2accfd2dfcd086d Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 4 May 2026 15:21:04 +0200 Subject: [PATCH] gh-148600: Add OpenSSL 4.0.0 support to test configurations (#149356) Co-authored-by: Charlie Lin --- .github/workflows/build.yml | 1 + Lib/test/test_poplib.py | 4 +++- .../next/Tests/2026-04-21-12-33-14.gh-issue-148600.vnTb3t.rst | 1 + Tools/ssl/multissltests.py | 1 + 4 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 Misc/NEWS.d/next/Tests/2026-04-21-12-33-14.gh-issue-148600.vnTb3t.rst diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d4397fc7de5..1af3a0607f9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -283,6 +283,7 @@ jobs: - { name: openssl, version: 3.4.5 } - { name: openssl, version: 3.5.6 } - { name: openssl, version: 3.6.2 } + - { name: openssl, version: 4.0.0 } ## AWS-LC - { name: aws-lc, version: 1.72.1 } env: diff --git a/Lib/test/test_poplib.py b/Lib/test/test_poplib.py index 18ca7cb5568..f08b945c8f5 100644 --- a/Lib/test/test_poplib.py +++ b/Lib/test/test_poplib.py @@ -185,7 +185,8 @@ class DummyPOP3Handler(asynchat.async_chat): elif err.args[0] == ssl.SSL_ERROR_EOF: return self.handle_close() # TODO: SSLError does not expose alert information - elif ("SSLV3_ALERT_BAD_CERTIFICATE" in err.args[1] or + elif ("TLS_ALERT_BAD_CERTIFICATE" in err.args[1] or + "SSLV3_ALERT_BAD_CERTIFICATE" in err.args[1] or "SSLV3_ALERT_CERTIFICATE_UNKNOWN" in err.args[1]): return self.handle_close() raise @@ -423,6 +424,7 @@ class TestPOP3Class(TestCase): self.assertEqual(ctx.check_hostname, True) with self.assertRaises(ssl.CertificateError): resp = self.client.stls(context=ctx) + self.client = poplib.POP3("localhost", self.server.port, timeout=test_support.LOOPBACK_TIMEOUT) resp = self.client.stls(context=ctx) diff --git a/Misc/NEWS.d/next/Tests/2026-04-21-12-33-14.gh-issue-148600.vnTb3t.rst b/Misc/NEWS.d/next/Tests/2026-04-21-12-33-14.gh-issue-148600.vnTb3t.rst new file mode 100644 index 00000000000..a7d4c0cc80a --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2026-04-21-12-33-14.gh-issue-148600.vnTb3t.rst @@ -0,0 +1 @@ +Add OpenSSL 4.0.0 support to test configurations. diff --git a/Tools/ssl/multissltests.py b/Tools/ssl/multissltests.py index 6be1a5ae94e..ad3e4b6596e 100755 --- a/Tools/ssl/multissltests.py +++ b/Tools/ssl/multissltests.py @@ -54,6 +54,7 @@ OPENSSL_RECENT_VERSIONS = [ "3.4.5", "3.5.6", "3.6.2", + "4.0.0", # See make_ssl_data.py for notes on adding a new version. ]