summaryrefslogtreecommitdiffstats
path: root/Lib/socket.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-08-25 15:08:43 (GMT)
committerGuido van Rossum <guido@python.org>2007-08-25 15:08:43 (GMT)
commit4f2c3ddca45c11d466bf487d16d74fe875536e3f (patch)
tree494ac4ce52ddc06df41589ba3e0080ea48b5851c /Lib/socket.py
parent1a42ece0c76166b1dead10decb0e54af084b4eb2 (diff)
downloadcpython-4f2c3ddca45c11d466bf487d16d74fe875536e3f.zip
cpython-4f2c3ddca45c11d466bf487d16d74fe875536e3f.tar.gz
cpython-4f2c3ddca45c11d466bf487d16d74fe875536e3f.tar.bz2
Server-side SSL and certificate validation, by Bill Janssen.
While cleaning up Bill's C style, I may have cleaned up some code he didn't touch as well (in _ssl.c).
Diffstat (limited to 'Lib/socket.py')
-rw-r--r--Lib/socket.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/Lib/socket.py b/Lib/socket.py
index 45a122f..48bb4f6 100644
--- a/Lib/socket.py
+++ b/Lib/socket.py
@@ -68,11 +68,10 @@ if _have_ssl:
_realsocket = socket
if _have_ssl:
- _realssl = ssl
def ssl(sock, keyfile=None, certfile=None):
- if hasattr(sock, "_sock"):
- sock = sock._sock
- return _realssl(sock, keyfile, certfile)
+ import ssl as realssl
+ return realssl.sslwrap_simple(sock, keyfile, certfile)
+ __all__.append("ssl")
# WSA error codes
if sys.platform.lower().startswith("win"):