-
-
Notifications
You must be signed in to change notification settings - Fork 30.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SSL: APPLICATION_DATA_AFTER_CLOSE_NOTIFY #125981
Comments
We also use Quart a lot so just for fun i decided to try it out, and i was able to replicate on Linux 6.11 as well under python Very interestingly this issue only appears when the request is made from the browser, and not via curl even after attempting different configurations to try to match the browser behavior such as For a better example i used Inspecting the TLS/TCP communication in wireshark it seems that the browser request makes the server send multiple closing frames exactly 5 seconds later after the initial connection is done.
Edit: The issue also appears in Python 3.12 so this might just be a library issue and should probably be directed at hypercorn or quart itself. |
Thanks for the investigation. |
Without having looked at the hypercorn source code it does appear that a library functionality is running a task that calls shutdown on the TLS connection after 5 seconds. It is VERY odd the issue only occurs when used via a browser, so maybe it is a mismatch in the expected connection lifetime? I tested it with firefox 131. |
This issue is already tracked (with no real progress it seems) in hypercorn itself pgjones/hypercorn#261. In the previous issue it is noted that it might have been an asyncio bug. |
The strange thing is that I have the same code running on a Win 2022 server with Py 3.12.2 and there is no issue at all. |
Sorry, I was wrong, the error does not come if I make a request to server from my PC.
|
I am able to reproduce in python 3.12.2 as well but interestingly i cannot replicate when making requests either via Chrome or my iPhone (Safari) to neither localhost/loopback or a remote address. But it happens consistently with Firefox for me. Is your certificate chain added to your clients, ei. are they accepted, i am testing with some that are invalid. |
I am using locally generated cert, as suggested here with the line: |
I am setting up a minimal example here with hypercorn and some headless firefox / chrome etc, we should be able to bisect the issue quite efficiently then. |
I have a minimal example here, but the issue does not occur when making the requests in a very naive way with headless firefox / chrome here but still with a browser manually. https://github.com/cjavad/python-hypercorn-issue-125981-repo It might be wise to move this issue into hypercorn initially until an underlying issue can be identified. Edit: Keeping the browser open for longer than 5 seconds triggers the issue. |
On another laptop Py 3.12.0, the error comes when accessing the page with FF only when I stop the server in cmd window (with CTRL+C).
This might eventually be another issue, I am not sure. |
Well, now it comes on the other laptop as well:
And then I cannot even stop the server, CTRL+C does not work, I have to forcibly close the CMD window. |
While I know it's frustrating, but until we have a MWE that is CPython-only, I don't think we can do much here =/. I suggest transfering this issue to hypercorn as it was suggested (but feel free to come back here if the issue can be reproduced without this library and/or something is wrong on our side). |
Closing as |
Bug report
Bug description:
Hi,
I have implemented a very simple application using Quart.
OS: WIndows 11
Python version: 3.13.0
The content of
main.py
:Server started with
py main.py
.Then I visit the web page on
https://localhost:3000
.After exactly 5 seconds I get this message:
CPython versions tested on:
3.13
Operating systems tested on:
Windows
The text was updated successfully, but these errors were encountered: