Skip to content

Commit 586a780

Browse files
author
Wojciech Nowak
committed
SSL_CTX_set_ciphersuites for tlsv3 context
1 parent 482b95e commit 586a780

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/OpenSSL/SSL.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1320,6 +1320,26 @@ def set_tmp_ecdh(self, curve):
13201320
"""
13211321
_lib.SSL_CTX_set_tmp_ecdh(self._context, curve._to_EC_KEY())
13221322

1323+
def set_ciphersuites(self, cipher_list):
1324+
"""
1325+
Set the list of ciphers to be used to configure the available TLSv1.3
1326+
ciphersuites for this context.
1327+
1328+
See the OpenSSL manual for more information (e.g.
1329+
:manpage:`ciphers(1)`).
1330+
1331+
:param bytes cipher_list: An OpenSSL cipher string.
1332+
:return: None
1333+
"""
1334+
cipher_list = _text_to_bytes_and_warn("cipher_list", cipher_list)
1335+
1336+
if not isinstance(cipher_list, bytes):
1337+
raise TypeError("cipher_list must be a byte string.")
1338+
1339+
_openssl_assert(
1340+
_lib.SSL_CTX_set_ciphersuites(self._context, cipher_list) == 1
1341+
)
1342+
13231343
def set_cipher_list(self, cipher_list):
13241344
"""
13251345
Set the list of ciphers to be used in this context.

0 commit comments

Comments
 (0)