summaryrefslogtreecommitdiffstats
path: root/Lib/ssl.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/ssl.py')
-rw-r--r--Lib/ssl.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/Lib/ssl.py b/Lib/ssl.py
index e45e16b..c9ee71a 100644
--- a/Lib/ssl.py
+++ b/Lib/ssl.py
@@ -234,15 +234,19 @@ class SSLSocket (socket):
else:
return 0
+ def unwrap (self):
+ if self._sslobj:
+ s = self._sslobj.shutdown()
+ self._sslobj = None
+ return s
+ else:
+ raise ValueError("No SSL wrapper around " + str(self))
+
def shutdown (self, how):
self._sslobj = None
socket.shutdown(self, how)
def close (self):
- self._sslobj = None
- socket.close(self)
-
- def close (self):
if self._makefile_refs < 1:
self._sslobj = None
socket.close(self)