mirror of
https://github.com/python/cpython.git
synced 2025-07-23 11:15:24 +00:00
bpo-43921: Fix test_ssl.test_pha_required_nocert() (GH-26489)
Fix test_pha_required_nocert() of test_ssl: catch two more EOF cases
(when the recv() method returns an empty string).
(cherry picked from commit 320eaa7f42
)
Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
parent
6563ea5c60
commit
e5e93e6145
2 changed files with 11 additions and 2 deletions
|
@ -4464,11 +4464,18 @@ class TestPostHandshakeAuth(unittest.TestCase):
|
|||
'(certificate required|EOF occurred)'
|
||||
):
|
||||
# receive CertificateRequest
|
||||
self.assertEqual(s.recv(1024), b'OK\n')
|
||||
data = s.recv(1024)
|
||||
if not data:
|
||||
raise ssl.SSLError(1, "EOF occurred")
|
||||
self.assertEqual(data, b'OK\n')
|
||||
|
||||
# send empty Certificate + Finish
|
||||
s.write(b'HASCERT')
|
||||
|
||||
# receive alert
|
||||
s.recv(1024)
|
||||
data = s.recv(1024)
|
||||
if not data:
|
||||
raise ssl.SSLError(1, "EOF occurred")
|
||||
|
||||
def test_pha_optional(self):
|
||||
if support.verbose:
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
Fix test_pha_required_nocert() of test_ssl: catch two more EOF cases (when
|
||||
the ``recv()`` method returns an empty string). Patch by Victor Stinner.
|
Loading…
Add table
Add a link
Reference in a new issue