From: Martin v. Löwis Date: Sat, 14 Jun 2003 13:30:53 +0000 (+0000) Subject: Always unwrap _socketobj in socket.ssl. Revert httplib.py 1.25. X-Git-Tag: v2.3c1~443 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1867f244168b0f809c4b8796e374e68c21ba880f;p=thirdparty%2FPython%2Fcpython.git Always unwrap _socketobj in socket.ssl. Revert httplib.py 1.25. Fixes #754447. --- diff --git a/Lib/httplib.py b/Lib/httplib.py index efd48423cc44..7eb9ad76498f 100644 --- a/Lib/httplib.py +++ b/Lib/httplib.py @@ -956,10 +956,7 @@ class HTTPSConnection(HTTPConnection): sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.connect((self.host, self.port)) - realsock = sock - if hasattr(sock, "_sock"): - realsock = sock._sock - ssl = socket.ssl(realsock, self.key_file, self.cert_file) + ssl = socket.ssl(sock, self.key_file, self.cert_file) self.sock = FakeSocket(sock, ssl) diff --git a/Lib/socket.py b/Lib/socket.py index b95c372da5f3..8e30ce0a34a2 100644 --- a/Lib/socket.py +++ b/Lib/socket.py @@ -65,16 +65,12 @@ if _have_ssl: __all__.extend(os._get_exports_list(_ssl)) _realsocket = socket -if (sys.platform.lower().startswith("win") - or (hasattr(os, 'uname') and os.uname()[0] == "BeOS") - or sys.platform=="riscos"): - - if _have_ssl: - _realssl = ssl - def ssl(sock, keyfile=None, certfile=None): - if hasattr(sock, "_sock"): - sock = sock._sock - return _realssl(sock, keyfile, certfile) +if _have_ssl: + _realssl = ssl + def ssl(sock, keyfile=None, certfile=None): + if hasattr(sock, "_sock"): + sock = sock._sock + return _realssl(sock, keyfile, certfile) # WSA error codes if sys.platform.lower().startswith("win"):