X-Git-Url: https://pwan.org/git/?a=blobdiff_plain;f=certmaster%2FSSLConnection.py;h=3e72d5e1d5c897e21af1b4026660520f2a363cce;hb=HEAD;hp=c266906f35b5f27f7e5ab1f57c896e3cdc2658c9;hpb=2108f87ee704ac86f5a6b924c03afc86e0fa617d;p=certmaster.git diff --git a/certmaster/SSLConnection.py b/certmaster/SSLConnection.py index c266906..3e72d5e 100644 --- a/certmaster/SSLConnection.py +++ b/certmaster/SSLConnection.py @@ -62,7 +62,7 @@ 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 @@ -97,6 +97,9 @@ class SSLConnection: 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