#296 AttributeError: sendall when using HTTPS

open
nobody
SOAPpy (75)
5
2011-02-02
2011-02-02
Anonymous
No

Time TimeoutSocket fake socket doesn't have a sendall method so you get the above error when using https.

Discussion

  • J Y
    J Y
    2011-02-09

    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):