Uh oh!
There was an error while loading. Please reload this page.
gh-110467: Fix EOF occurred in violation of protocol starting Python3.10 on large requests - #115273
gh-110467: Fix EOF occurred in violation of protocol starting Python3.10 on large requests#115273keepworking wants to merge 7 commits into
Conversation
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
keepworking
commented
Feb 11, 2024
Hello, @tiran I have qustion about this update of test code When I looked at the linked pull request, I could see that the processing of Before the correction, the server is not stopped when the error is I wonder if this is the intended correction. except (ConnectionResetError, ConnectionAbortedError):
# XXX: OpenSSL 1.1.1 sometimes raises ConnectionResetError# when connection is not shut down gracefully.ifself.server.chattyandsupport.verbose:
sys.stdout.write(
" Connection reset by peer: {}\n".format(
self.addr)
)
self.close()
self.running=False# <<<<< do not stop the server in this exceptionexceptssl.SSLErroraserr:
# On Windows sometimes test_pha_required_nocert receives the# PEER_DID_NOT_RETURN_A_CERTIFICATE exception# before the 'tlsv13 alert certificate required' exception.# If the server is stopped when PEER_DID_NOT_RETURN_A_CERTIFICATE# is received test_pha_required_nocert fails with ConnectionResetError# because the underlying socket is closedif'PEER_DID_NOT_RETURN_A_CERTIFICATE'==err.reason:
ifself.server.chattyandsupport.verbose:
sys.stdout.write(err.args[1])
# test_pha_required_nocert is expecting this exceptionraisessl.SSLError('tlsv13 alert certificate required')
exceptOSError:
ifself.server.chatty:
handle_error("Test server failure:\n")
self.close()
self.running=False# normally, we'd just stop here, but for the test# harness, we want to stop the serverself.server.stop()exceptOSErrorase:
# handles SSLError and socket errorsifself.server.chattyandsupport.verbose:
ifisinstance(e, ConnectionError):
# OpenSSL 1.1.1 sometimes raises# ConnectionResetError when connection is not# shut down gracefully.print(
f" Connection reset by peer: {self.addr}"
)
else:
handle_error("Test server failure:\n")
try:
self.write(b"ERROR\n")
exceptOSError:
passself.close()
self.running=False# normally, we'd just stop here, but for the test# harness, we want to stop the serverself.server.stop()
# <<<<< stop the server in this exception |
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
…rt assertRaisesRegex (append OSError)
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
…rt assertRaisesRegex (modify ConnectionResetError -> closed by the remote host)
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
keepworking
commented
Feb 18, 2024
moved issue to #115627 |
In the process of upgrading from Python 3.9 to 3.10, 'SSL_write()' was changed to 'SSL_write_ex()'.
At this time, the range of the return value of each function was different and corresponded within the function '_ssl__SSLSocket_write_impl', but the function 'PySSL_SetError' did not correspond to this.
Therefore, even if there is 'err.c' in 'SSL_ERROR_SYSCALL', the return value of 'SSL_write_ex' is always 0, so it cannot enter the condition statement.
If this commitment is approved, all of 3.10, 3.11, and 3.12 are backportable.