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
Before upgrading to flask-socketio's 1.x version, I was able to use socketio with ssl. After upgrading, and changing nothing on my side, I am getting the following error output.
<socket fileno=19 sock=10.125.16.202:5000 peer=149.101.37.2:27486>: Expected GET method: '\x16\x03\x01\x00\x82\x01\x00\x00~\x03\x01V\x85z\x15#\xbc\x9b\x13\xd7:f\xb0a\xd0\xf7\xde\xcd\x1b\xf6\x15fb\x99RaUg\xd9\x89\x1d\xe2\x0b\x00\x00\x18\xc0\x14\xc0\x13\xc0\n'
Traceback (most recent call last):
File "/usr/lib/python2.7/logging/__init__.py", line 874, in emit
stream.write(fs % msg.encode("UTF-8"))
File "/usr/lib/python2.7/encodings/utf_8.py", line 16, in decode
return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0x82 in position 87: invalid start byte
Logged from file handler.py, line 237
My code is similar to this:
app=Flask(__name__)
app.debug=Trueapp.config['SECRET_KEY'] ='secret!'socketio=SocketIO(app)
# .... some other codeSOCKET_SSL_KEY_FILE='/etc/something.key'SOCKET_SSL_CERT_FILE='/etc/something.crt'if__name__=='__main__':
socketio.run(
app,
host="0.0.0.0",
port=5000,
keyfile=SOCKET_SSL_KEY_FILE,
certfile=SOCKET_SSL_CERT_FILE)
Yep, I agree on the problem and the solution. I actually do this for eventlet, but somehow missed it for gevent. Feel free to send the PR, I'll merge right away. Thanks!
Before upgrading to flask-socketio's 1.x version, I was able to use socketio with ssl. After upgrading, and changing nothing on my side, I am getting the following error output.
My code is similar to this:
I investigated a little bit and came across that ssl keyword arguments were not passed to gevent side. https://github.com/miguelgrinberg/Flask-SocketIO/blob/master/flask_socketio/__init__.py#L398
when I change the statement like the following it works:
If you confirm the problem and the offered solution, I can send a quick pull request.
The text was updated successfully, but these errors were encountered: