Fix test_https_over_http_error on Windows with OpenSSL 3.1+#828
Open
julianz- wants to merge 1 commit into
Open
Fix test_https_over_http_error on Windows with OpenSSL 3.1+#828julianz- wants to merge 1 commit into
julianz- wants to merge 1 commit into
Conversation
cc2efd3 to
deeb517
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #828 +/- ##
==========================================
+ Coverage 78.19% 78.20% +0.01%
==========================================
Files 41 41
Lines 4788 4791 +3
Branches 547 548 +1
==========================================
+ Hits 3744 3747 +3
Misses 905 905
Partials 139 139 |
On Windows, the TCP reset (RST) takes a different code path than Linux, causing OpenSSL 3.1+ to report 'wrong version number' rather than 'record layer failure'. Accept either string when IS_ABOVE_OPENSSL31 is True — the same pattern used in CPython's own test_ssl.py.
deeb517 to
f5bb643
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
test_https_over_http_errorstarted failing in the CI on Windows with Python 3.14 after recent GitHub Actions runner image updates bumped Python 3.14.5 → 3.14.6 and OpenSSL 3.6.2 → 3.6.3 (win25/20260614.167 deployed ~June 19, win22/20260616.203 deployed shortly after).The test expects record layer failure when
IS_ABOVE_OPENSSL31isTrue(OpenSSL > 3.1), but with Python 3.14.6 bundling OpenSSL 3.6.3 on Windows both windows-2025 and windows-2022 now returnwrong version numberinstead. This is a known Windows behavior: the TCP reset is surfaced to userspace before OpenSSL fully processes the server's response, causing a different error code to be reported (documented in CPython's own test_ssl.py).Linux is currently unaffected — Ubuntu 24.04 uses system OpenSSL 3.0.x, so
IS_ABOVE_OPENSSL31isFalsethere and the test falls through to the elifIS_ABOVE_OPENSSL10branch, which already expectswrong version number.❓ What kind of change does this PR introduce?
📋 What is the related issue number (starting with
#)Resolves #
❓ What is the current behavior? (You can also link to an open issue here)
CI errors:
e.g.
https://github.com/cherrypy/cheroot/actions/runs/27889445941/job/82595847403?pr=827
❓ What is the new behavior (if this is a feature change)?
📋 Other information:
📋 Contribution checklist:
(If you're a first-timer, check out
[this guide on making great pull requests][making a lovely PR])
the changes have been approved
and description in grammatically correct, complete sentences