in python 2.7 - the things we are sending can also be a 'memoryview' object
[certmaster.git] / certmaster / SSLConnection.py
index 98ed8a0..93fabb6 100644 (file)
@@ -8,7 +8,7 @@
 
 from OpenSSL import SSL
 import time, socket, select
-from func.CommonErrors import canIgnoreSSLError
+from CommonErrors import canIgnoreSSLError
 
 
 class SSLConnection:
@@ -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