FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-158646: Fix flake in test_shutdown_corrupted_ssl_sends_close_notify by deadlovelll · Pull Request #158877 · python/cpython · GitHub

Repository navigation

Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (2) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
6 changes: 4 additions & 2 deletions Lib/test/test_asyncio/functional.py
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
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,14 @@ def recv_all(self, n):

def start_tls(self, ssl_context, *,
server_side=False,
server_hostname=None):
server_hostname=None,
suppress_ragged_eofs=True):

ssl_sock = ssl_context.wrap_socket(
self.__sock, server_side=server_side,
server_hostname=server_hostname,
do_handshake_on_connect=False)
do_handshake_on_connect=False,
suppress_ragged_eofs=suppress_ragged_eofs)

try:
ssl_sock.do_handshake()
Expand Down
7 changes: 4 additions & 3 deletions Lib/test/test_asyncio/test_sslproto.py
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
Original file line number Diff line number Diff line change
Expand Up @@ -954,14 +954,15 @@ def server(sock):
try:
sock.start_tls(
sslctx,
server_side=True)
server_side=True,
suppress_ragged_eofs=False)
sock.sendall(b'A\n')
sock.recv_all(1)
orig_sock.send(b'please corrupt the SSL connection')
# the client now closes the connection; although its
# TLS shutdown fails on the corrupted record, it must
# still send close_notify, completing our unwrap()
sock.unwrap()
# still send close_notify
self.assertEqual(sock.recv(1), b'')
except ssl.SSLError as exc:
server_err = exc
finally:
Expand Down
Loading

Back | FazBrowse Home | New Git URL