ssl.SSLZeroReturnError: TLS/SSL connection has been closed (EOF) (
This is my code:
import ssl, socket server ='10.10.10.9'
port = 50443
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
ssl_sock =ssl.wrap_socket(sock,ssl_version=ssl.PROTOCOL_SSLv3)
ssl_sock.connect((server, port))
return ssl_sock
I am Getting below error:
File "/home/ragav/trunk/lib/Ipdu.py", line 35, in open_socket
ssl_sock.connect((server, port))
File "/usr/local/lib/python2.7/ssl.py", line 876, in connect
self._real_connect(addr, False)
File "/usr/local/lib/python2.7/ssl.py", line 867, in _real_connect
self.do_handshake()
File "/usr/local/lib/python2.7/ssl.py", line 840, in do_handshake
self._sslobj.do_handshake()
ssl.SSLZeroReturnError: TLS/SSL connection has been closed (EOF) (_ssl.c:661)
This might be due to openssl version. check your openssl version if its 0.9 then that might be a reason for the error. You can check openssl version in your python code using
print ssl.OPENSSL_VERSION
链接地址: http://www.djcxy.com/p/56444.html
上一篇: Python错误计算