使用gevent的SSLEOFError

时间:2018-03-01 03:27:25

标签: python ssl gevent

我在gevent中使用pywsgi,如下所示:

 http_server = pywsgi.WSGIServer(('0.0.0.0', 5000), app, keyfile="server.key", certfile="server.crt",ssl_version= ssl.PROTOCOL_SSLv23 )

Android应用程序连接到我的服务器,有时会出现错误,原因是什么以及如何解决?

我尝试使用curl并发现我的服务器支持tlsv1.0,1.1和1.2,不支持sslv2和3.很久以前Android支持tlsv1.0。所以似乎问题不是版本ssl协议。

Traceback (most recent call last):
File "/home/ec2-user/python-env/py3env/local/lib64/python3.4/site-packages/ge$ent/greenlet.py",line 536, in run
result = self._run(*self.args, **self.kwargs)
File "/home/ec2-user/python-env/py3env/local/lib64/python3.4/site-packages/ge$ent/baseserver.py", line 26, in _handle_and_close_when_done
return handle(*args_tuple)
File "/home/ec2-user/python-env/py3env/local/lib64/python3.4/site-packages/ge$ent/server.py", line 174, in wrap_socket_and_handle
ssl_socket = self.wrap_socket(client_socket, **self.ssl_args)
File "/home/ec2-user/python-env/py3env/local/lib64/python3.4/site-packages/ge$ent/_ssl3.py", line 642, in wrap_socket
ciphers=ciphers)
File "/home/ec2-user/python-env/py3env/local/lib64/python3.4/site-packages/gevent/_ssl3.py", line 232, in __init__
raise x
File "/home/ec2-user/python-env/py3env/local/lib64/python3.4/site-packages/gevent/_ssl3.py", line 228, in __init__
self.do_handshake()
File "/home/ec2-user/python-env/py3env/local/lib64/python3.4/site-packages/gevent/_ssl3.py", line 545, in do_handshake
self._sslobj.do_handshake()
ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:600)
Thu Mar  1 03:00:23 2018 <Greenlet at 0x7f93d0e2daf8: _handle_and_close_when_done(<bound method WSGIServer.wrap_socket_and_handle of, <bound method WSGIServer.do_close of <WSGIServer a, (<gevent._socket3.socket [closed]  object, fd=-1, )> failed with SSLEOFError

0 个答案:

没有答案