mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
Issue #13634: Add support for querying and disabling SSL compression.
This commit is contained in:
parent
3563b18c19
commit
8abdb8abd8
6 changed files with 83 additions and 0 deletions
11
Lib/ssl.py
11
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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue