https://github.com/python/cpython/commit/ff88ee4b3a404310d60a716aeb9c153e47dec07c
commit: ff88ee4b3a404310d60a716aeb9c153e47dec07c
branch: 3.13
author: Miss Islington (bot) <[email protected]>
committer: freakboy3742 <[email protected]>
date: 2026-04-14T11:54:43+08:00
summary:

[3.13] gh-148508: Add resilience to SSL preauth tests on iOS (GH-148536) 
(#148540)

Adds handling for a test case seen in the iOS SSL tests where an SSL connection 
fails to
handshake correctly.
(cherry picked from commit c40e8b016a90820e4d799922903b90a505ffaf55)

Co-authored-by: Russell Keith-Magee <[email protected]>

files:
A Misc/NEWS.d/next/Library/2026-04-14-09-04-35.gh-issue-148508.-GiXml.rst
M Lib/test/test_ssl.py

diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
index fbbe918af75e69..453919d2a4aab9 100644
--- a/Lib/test/test_ssl.py
+++ b/Lib/test/test_ssl.py
@@ -5268,15 +5268,20 @@ def non_linux_skip_if_other_okay_error(self, err):
             return  # Expect the full test setup to always work on Linux.
         if (isinstance(err, ConnectionResetError) or
             (isinstance(err, OSError) and err.errno == errno.EINVAL) or
-            re.search('wrong.version.number', str(getattr(err, "reason", "")), 
re.I)):
+            re.search('wrong.version.number', str(getattr(err, "reason", "")), 
re.I) or
+            re.search('record.layer.failure', str(getattr(err, "reason", "")), 
re.I)
+        ):
             # On Windows the TCP RST leads to a ConnectionResetError
             # (ECONNRESET) which Linux doesn't appear to surface to userspace.
             # If wrap_socket() winds up on the "if connected:" path and doing
-            # the actual wrapping... we get an SSLError from OpenSSL. Typically
-            # WRONG_VERSION_NUMBER. While appropriate, neither is the scenario
-            # we're specifically trying to test. The way this test is written
-            # is known to work on Linux. We'll skip it anywhere else that it
-            # does not present as doing so.
+            # the actual wrapping... we get an SSLError from OpenSSL. This is
+            # typically WRONG_VERSION_NUMBER. The same happens on iOS, but
+            # RECORD_LAYER_FAILURE is the error.
+            #
+            # While appropriate, neither is the scenario we're specifically
+            # trying to test. The way this test is written is known to work on
+            # Linux. We'll skip it anywhere else that it does not present as
+            # doing so.
             try:
                 self.skipTest(f"Could not recreate conditions on 
{sys.platform}:"
                               f" {err=}")
diff --git 
a/Misc/NEWS.d/next/Library/2026-04-14-09-04-35.gh-issue-148508.-GiXml.rst 
b/Misc/NEWS.d/next/Library/2026-04-14-09-04-35.gh-issue-148508.-GiXml.rst
new file mode 100644
index 00000000000000..7995dec397f7b7
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2026-04-14-09-04-35.gh-issue-148508.-GiXml.rst
@@ -0,0 +1,2 @@
+An intermittent timing error when running SSL tests on iOS has been
+resolved.

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to