summaryrefslogtreecommitdiffstats
path: root/Lib/ssl.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2011-12-20 09:13:40 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2011-12-20 09:13:40 (GMT)
commit8abdb8abd856f0dbbb3120428f0bf1d282007c32 (patch)
tree051c7264f4bfc195f49136483c263808d4ef7e4b /Lib/ssl.py
parent3563b18c19c37902ecbc6ab28c92b3674a3eed32 (diff)
downloadcpython-8abdb8abd856f0dbbb3120428f0bf1d282007c32.zip
cpython-8abdb8abd856f0dbbb3120428f0bf1d282007c32.tar.gz
cpython-8abdb8abd856f0dbbb3120428f0bf1d282007c32.tar.bz2
Issue #13634: Add support for querying and disabling SSL compression.
Diffstat (limited to 'Lib/ssl.py')
-rw-r--r--Lib/ssl.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/ssl.py b/Lib/ssl.py
index d244104..0b2f743 100644
--- a/Lib/ssl.py
+++ b/Lib/ssl.py
@@ -70,6 +70,10 @@ from _ssl import (
OP_ALL, OP_NO_SSLv2, OP_NO_SSLv3, OP_NO_TLSv1,
OP_CIPHER_SERVER_PREFERENCE, OP_SINGLE_ECDH_USE,
)
+try:
+ from _ssl import OP_NO_COMPRESSION
+except ImportError:
+ pass
from _ssl import RAND_status, RAND_egd, RAND_add, RAND_bytes, RAND_pseudo_bytes
from _ssl import (
SSL_ERROR_ZERO_RETURN,
@@ -330,6 +334,13 @@ class SSLSocket(socket):
else:
return self._sslobj.cipher()
+ def compression(self):
+ self._checkClosed()
+ if not self._sslobj:
+ return None
+ else:
+ return self._sslobj.compression()
+
def send(self, data, flags=0):
self._checkClosed()
if self._sslobj: