Time TimeoutSocket fake socket doesn't have a sendall method so you get the above error when using https.
here's what i did to fix this issue.
--- Utility.py (revision 1498) +++ Utility.py (working copy) @@ -14,7 +14,7 @@
ident = "$Id$"
-import sys, types, httplib, urllib, socket, weakref +import sys, types, httplib, urllib, socket, weakref, ssl from os.path import isfile from string import join, strip, split from UserDict import UserDict @@ -139,9 +139,7 @@ def connect(self): sock = TimeoutSocket(self.timeout) sock.connect((self.host, self.port)) - realsock = getattr(sock.sock, '_sock', sock.sock) - ssl = socket.ssl(realsock, self.key_file, self.cert_file) - self.sock = httplib.FakeSocket(sock, ssl) + self.sock = ssl.wrap_socket(sock, self.key_file, self.cert_file)
def urlopen(url, timeout=20, redirects=None):
Log in to post a comment.
here's what i did to fix this issue.
Index: Utility.py
--- Utility.py (revision 1498)
+++ Utility.py (working copy)
@@ -14,7 +14,7 @@
ident = "$Id$"
-import sys, types, httplib, urllib, socket, weakref
+import sys, types, httplib, urllib, socket, weakref, ssl
from os.path import isfile
from string import join, strip, split
from UserDict import UserDict
@@ -139,9 +139,7 @@
def connect(self):
sock = TimeoutSocket(self.timeout)
sock.connect((self.host, self.port))
- realsock = getattr(sock.sock, '_sock', sock.sock)
- ssl = socket.ssl(realsock, self.key_file, self.cert_file)
- self.sock = httplib.FakeSocket(sock, ssl)
+ self.sock = ssl.wrap_socket(sock, self.key_file, self.cert_file)
def urlopen(url, timeout=20, redirects=None):