aiohttp icon indicating copy to clipboard operation
aiohttp copied to clipboard

Change invalid error message when first two bytes of method begin with `\x16\x03`

Open bdraco opened this issue 1 year ago • 0 comments

I think it makes sense to make it a debug log at this point, though the noisiness in the past has been pretty helpful as most exceptions reported turned out to be parser bugs. I'm a lot more confident in the parser these days, so don't mind reducing the output.

But, even logging, we should improve the error message in this specific case by checking the first 2 bytes are \x16\x03 to make it easier to debug. Surely all those homeassistant issues will be more difficult for users to debug with the linked PR? i.e. They are now less likely to see the errors and those errors still don't explain the issue with their client clearly. I think HTTPS on HTTP port is such a common case that we can special case it. @bdraco Maybe something even simpler than #10067 and just change the error message (rather than the exception class)?

Originally posted by @Dreamsorcerer in https://github.com/aio-libs/aiohttp/issues/8065#issuecomment-2508779579

bdraco avatar Dec 07 '24 14:12 bdraco