mirror of
https://github.com/python/cpython.git
synced 2025-10-17 12:18:23 +00:00
Issue #13895: fix test_ssl hanging under Ubuntu
This commit is contained in:
commit
ce816a5111
1 changed files with 25 additions and 25 deletions
|
@ -1198,33 +1198,33 @@ else:
|
||||||
chatty=chatty,
|
chatty=chatty,
|
||||||
connectionchatty=False)
|
connectionchatty=False)
|
||||||
with server:
|
with server:
|
||||||
s = client_context.wrap_socket(socket.socket())
|
with client_context.wrap_socket(socket.socket()) as s:
|
||||||
s.connect((HOST, server.port))
|
s.connect((HOST, server.port))
|
||||||
for arg in [indata, bytearray(indata), memoryview(indata)]:
|
for arg in [indata, bytearray(indata), memoryview(indata)]:
|
||||||
|
if connectionchatty:
|
||||||
|
if support.verbose:
|
||||||
|
sys.stdout.write(
|
||||||
|
" client: sending %r...\n" % indata)
|
||||||
|
s.write(arg)
|
||||||
|
outdata = s.read()
|
||||||
|
if connectionchatty:
|
||||||
|
if support.verbose:
|
||||||
|
sys.stdout.write(" client: read %r\n" % outdata)
|
||||||
|
if outdata != indata.lower():
|
||||||
|
raise AssertionError(
|
||||||
|
"bad data <<%r>> (%d) received; expected <<%r>> (%d)\n"
|
||||||
|
% (outdata[:20], len(outdata),
|
||||||
|
indata[:20].lower(), len(indata)))
|
||||||
|
s.write(b"over\n")
|
||||||
if connectionchatty:
|
if connectionchatty:
|
||||||
if support.verbose:
|
if support.verbose:
|
||||||
sys.stdout.write(
|
sys.stdout.write(" client: closing connection.\n")
|
||||||
" client: sending %r...\n" % indata)
|
stats = {
|
||||||
s.write(arg)
|
'compression': s.compression(),
|
||||||
outdata = s.read()
|
'cipher': s.cipher(),
|
||||||
if connectionchatty:
|
}
|
||||||
if support.verbose:
|
s.close()
|
||||||
sys.stdout.write(" client: read %r\n" % outdata)
|
return stats
|
||||||
if outdata != indata.lower():
|
|
||||||
raise AssertionError(
|
|
||||||
"bad data <<%r>> (%d) received; expected <<%r>> (%d)\n"
|
|
||||||
% (outdata[:20], len(outdata),
|
|
||||||
indata[:20].lower(), len(indata)))
|
|
||||||
s.write(b"over\n")
|
|
||||||
if connectionchatty:
|
|
||||||
if support.verbose:
|
|
||||||
sys.stdout.write(" client: closing connection.\n")
|
|
||||||
stats = {
|
|
||||||
'compression': s.compression(),
|
|
||||||
'cipher': s.cipher(),
|
|
||||||
}
|
|
||||||
s.close()
|
|
||||||
return stats
|
|
||||||
|
|
||||||
def try_protocol_combo(server_protocol, client_protocol, expect_success,
|
def try_protocol_combo(server_protocol, client_protocol, expect_success,
|
||||||
certsreqs=None, server_options=0, client_options=0):
|
certsreqs=None, server_options=0, client_options=0):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue