mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +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).
This commit is contained in:
parent
8916633b76
commit
320eaa7f42
2 changed files with 11 additions and 2 deletions
|
@ -4460,11 +4460,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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue