Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

bpo-43921: Cleanup test_ssl.test_wrong_cert_tls13()#26520

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
vstinner merged 1 commit intopython:mainfromvstinner:test_ssl3
Jun 3, 2021
Merged

bpo-43921: Cleanup test_ssl.test_wrong_cert_tls13()#26520

vstinner merged 1 commit intopython:mainfromvstinner:test_ssl3
Jun 3, 2021

Conversation

@vstinner
Copy link
Member

@vstinnervstinner commentedJun 3, 2021
edited by bedevere-bot
Loading

Don't catch OSError, and check the SSLError message.

https://bugs.python.org/issue43921

Don't catch OSError, and check the SSLError message.
@vstinner
Copy link
MemberAuthor

I don't see why a SSLSocket would raise an OSError on read()/write().

On ECONNRESET error, read() raises an SSLEOFError exception: seehttps://bugs.python.org/issue43921#msg394967

cc@tiran

@tiran
Copy link
Member

It's based on old code from Antoine, seetest_wrong_cert_tls12 and commita6a4dc8.

@vstinner
Copy link
MemberAuthor

It's based on old code from Antoine, see test_wrong_cert_tls12 and commit a6a4dc8.

I see. For test_wrong_cert_tls12(), SSLError or OSError is expected on connect(), not on read/write. There is a comment explaining the OSError:

# Expect either an SSL error about the server rejecting# the connection, or a low-level connection reset (which# sometimes happens on Windows)s.connect((HOST, server.port))

test_wrong_cert_tls13() is different because TLS 1.3 is different. The test doesn't expect any error on connect(), only on read() or write(). It also explained in a comment:

# TLS 1.3 perform client cert exchange after handshake

In short, test_wrong_cert_tls12() looks correct, and I now understand how test_wrong_cert_tls13() inheritedexcept OSError:. So I'm not convinced that it's ok to remove it :-)

@vstinnervstinner merged commit5c2191d intopython:mainJun 3, 2021
@vstinnervstinner deleted the test_ssl3 branchJune 3, 2021 20:12
@vstinner
Copy link
MemberAuthor

This change makes the test more strict (check the exact error message). I'm not sure that it works well on all platforms and all supported OpenSSL versions. I prefer to not backport the change to 3.10. At least, not now.

@tiran
Copy link
Member

Either keep 3.9 to 3.11 tests in sync or don't merge changes.

@miss-islington
Copy link
Contributor

Thanks@vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10.
🐍🍒⛏🤖

@miss-islington
Copy link
Contributor

Thanks@vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.9.
🐍🍒⛏🤖

@miss-islington
Copy link
Contributor

Sorry@vstinner, I had trouble checking out the3.10 backport branch.
Please backport usingcherry_picker on command line.
cherry_picker 5c2191df9a21a3b3d49dd0711b8d2b92591ce82b 3.10

@miss-islington
Copy link
Contributor

Sorry,@vstinner, I could not cleanly backport this to3.9 due to a conflict.
Please backport usingcherry_picker on command line.
cherry_picker 5c2191df9a21a3b3d49dd0711b8d2b92591ce82b 3.9

@tiran
Copy link
Member

@vstinner please backport changes to 3.10 and 3.9. Tests should be kept in sync.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@tirantiranAwaiting requested review from tiran

Assignees

@vstinnervstinner

Labels

skip newstestsTests in the Lib/test dir

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

6 participants

@vstinner@tiran@miss-islington@the-knights-who-say-ni@bedevere-bot@ZeroIntensity

[8]ページ先頭

©2009-2025 Movatter.jp