How to suppress gevent error message on flask server running HTTP when it gets an HTTPS request

15 views Asked by At

If I (or someone else) makes an HTTPS call against my "plain" flask server (expecting an HTTP request) running gevent, I get this message:

<gevent.socket3.socket at 0x103fd04c0 object, fd=7, family=30, type=1, proto=0>: (from ('::1', 50418, 0, 0)) Invalid HTTP method: '\x16\x03\x01\x01:\x01\x00\x016\x03\x03zGÀQÝQ0r\x0eCªðÏ\x19é!\x1dùº\x92u9\x92õ?\x0b%\x1b\x13\x00¦I \x01¸¨Q:â©\x86\x89¯ûo\x15õ\x07\x8cQ\xa0Ä$\x1d\x0e&8Å\x89\x1cî$jñ\x00b\x13\x03\x13\x02\x13\x01̨̩̪À0À,À(À$À\x14À\n'

I dont think the exception ever reaches python code so I cant catch the exception before it gets logged. Is there another way to suppress it?

0

There are 0 answers