-
Notifications
You must be signed in to change notification settings - Fork 129
Open
Description
I have code which returns http.response.body with more_body: False before calling receive to consume the entire request. This seems to cause a crash, only with TLS from what I've seen. Presumably, SSL is notifying the server that it received more data from the client despite the SSL context already being closed.
I always see this error for HTTP/1 and don't seem to see it with HTTP/2. I am running a test suite from here
https://github.com/i2y/connecpy/blob/main/conformance/test/test_server.py
E Traceback (most recent call last):
E File "/Users/anuraag/git/connecpy/.venv/lib/python3.12/site-packages/hypercorn/asyncio/task_group.py", line 27, in _handle
E await app(scope, receive, send, sync_spawn, call_soon)
E File "/Users/anuraag/git/connecpy/.venv/lib/python3.12/site-packages/hypercorn/app_wrappers.py", line 34, in __call__
E await self.app(scope, receive, send)
E File "/Users/anuraag/git/connecpy/src/connecpy/_server_async.py", line 142, in __call__
E await self._handle_stream(
E File "/Users/anuraag/git/connecpy/src/connecpy/_server_async.py", line 363, in _handle_stream
E await send(
E File "/Users/anuraag/git/connecpy/.venv/lib/python3.12/site-packages/hypercorn/protocol/http_stream.py", line 200, in app_send
E await self._send_closed()
E File "/Users/anuraag/git/connecpy/.venv/lib/python3.12/site-packages/hypercorn/protocol/http_stream.py", line 247, in _send_closed
E await self.send(StreamClosed(stream_id=self.stream_id))
E File "/Users/anuraag/git/connecpy/.venv/lib/python3.12/site-packages/hypercorn/protocol/h11.py", line 150, in stream_send
E await self._maybe_recycle()
E File "/Users/anuraag/git/connecpy/.venv/lib/python3.12/site-packages/hypercorn/protocol/h11.py", line 288, in _maybe_recycle
E await self.send(Closed())
E File "/Users/anuraag/git/connecpy/.venv/lib/python3.12/site-packages/hypercorn/asyncio/tcp_server.py", line 87, in protocol_send
E await self._close()
E File "/Users/anuraag/git/connecpy/.venv/lib/python3.12/site-packages/hypercorn/asyncio/tcp_server.py", line 119, in _close
E await self.writer.wait_closed()
E File "/Users/anuraag/.local/share/uv/python/cpython-3.12.6-macos-aarch64-none/lib/python3.12/asyncio/streams.py", line 364, in wait_closed
E await self._protocol._get_close_waiter(self)
E File "/Users/anuraag/.local/share/uv/python/cpython-3.12.6-macos-aarch64-none/lib/python3.12/asyncio/sslproto.py", line 648, in _do_shutdown
E self._sslobj.unwrap()
E File "/Users/anuraag/.local/share/uv/python/cpython-3.12.6-macos-aarch64-none/lib/python3.12/ssl.py", line 920, in unwrap
E return self._sslobj.shutdown()
E ^^^^^^^^^^^^^^^^^^^^^^^
E ssl.SSLError: [SSL: APPLICATION_DATA_AFTER_CLOSE_NOTIFY] application data after close notify (_ssl.c:2685)
Metadata
Metadata
Assignees
Labels
No labels