You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When an HTTPS request is sent to the HTTP server port, a generic exception is thrown aiohttp.http_exceptions.BadStatusLine: 400, message: Invalid method encountered.
This has caused confusion for some Home Assistant users with a misconfigured reverse-proxy set-up. With this message, it is not always clear where the issue is. Example.
To Reproduce
Send a HTTPS request on the HTTP port.
Expected behavior
b'\x16\x03' appears to be a known HTTPS connection message. Given that we know this, a more descriptive error message (in lieu of Invalid method encountered) could be provided, such as Received HTTPS traffic on HTTP port.
Logs/tracebacks
Logger: aiohttp.serverSource: /usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py:421
First occurred: 8:32:09 AM (12 occurrences)
Last logged: 8:32:10 AM
Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py", line 350, in data_received
messages, upgraded, tail =self._request_parser.feed_data(data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "aiohttp/_http_parser.pyx", line 557, in aiohttp._http_parser.HttpParser.feed_dataaiohttp.http_exceptions.BadStatusLine: 400, message:
Invalid method encountered:
b'\x16\x03\x03\x01F\x01'^
Python Version
3.11.6
aiohttp Version
3.9.1
multidict Version
6.0.4
yarl Version
1.9.4
OS
Home Assistant OS 11.4
Related component
Server
Additional context
No response
Code of Conduct
I agree to follow the aio-libs Code of Conduct
The text was updated successfully, but these errors were encountered:
This is becoming more frequent due to Chromium’s automatic HTTPS upgrades, where HTTPS requests are attempted on the same port if a port number is specified in the URL.
This error comes up quite often when there isn't anything actually wrong, and its quite expected that anything exposed to the public internet will get quite a bit of garbage traffic that will generate these errors. We should probably downgrade it to debug logging.
Describe the bug
When an HTTPS request is sent to the HTTP server port, a generic exception is thrown
aiohttp.http_exceptions.BadStatusLine: 400, message: Invalid method encountered
.This has caused confusion for some Home Assistant users with a misconfigured reverse-proxy set-up. With this message, it is not always clear where the issue is. Example.
To Reproduce
Send a HTTPS request on the HTTP port.
Expected behavior
b'\x16\x03' appears to be a known HTTPS connection message. Given that we know this, a more descriptive error message (in lieu of
Invalid method encountered
) could be provided, such asReceived HTTPS traffic on HTTP port
.Logs/tracebacks
Python Version
3.11.6
aiohttp Version
3.9.1
multidict Version
6.0.4
yarl Version
1.9.4
OS
Home Assistant OS 11.4
Related component
Server
Additional context
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: