from OpenSSL import SSL
import time, socket, select
-from func.CommonErrors import canIgnoreSSLError
+from CommonErrors import canIgnoreSSLError
class SSLConnection:
c, a = self.__dict__["conn"].accept()
return (SSLConnection(c), a)
- def makefile(self, mode, bufsize):
+ def makefile(self, mode='r', bufsize=-1):
"""
We need to use socket._fileobject Because SSL.Connection
doesn't have a 'dup'. Not exactly sure WHY this is, but
if not con in write:
raise socket.timeout((110, "Operation timed out."))
+ if hasattr(data, 'tobytes'):
+ data = data.tobytes()
+
starttime = time.time()
origlen = len(data)
sent = -1