Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions Modules/_ssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -3288,6 +3288,26 @@ _ssl__SSLContext_set_ciphers_impl(PySSLContext *self, const char *cipherlist)
Py_RETURN_NONE;
}


static PyObject *
_ssl_SSLContext_set_ciphers_tls3_impl(PySSLContext *self, const char* cipherlist)
{
int ret = SSL_CTX_set_ciphersuites(self->ctx, cipherlist);
if (ret == 0)
{
/* Similar to TLS 1.2 cipher suites, and OpenSSL versions, otherwise the error can be
* reported again.
*/
ERR_clear_error();
PyErr_SetString(get_state_ctx(self)->PySSLErrorObject, "No TLSv1.3 cipher could be selected");
return NULL;
}

Py_RETURN_NONE;
}



/*[clinic input]
_ssl._SSLContext.get_ciphers
[clinic start generated code]*/
Expand Down Expand Up @@ -5001,6 +5021,7 @@ static struct PyMethodDef context_methods[] = {
_SSL__SSLCONTEXT__WRAP_SOCKET_METHODDEF
_SSL__SSLCONTEXT__WRAP_BIO_METHODDEF
_SSL__SSLCONTEXT_SET_CIPHERS_METHODDEF
_SSL__SSLCONTEXT_SET_CIPHERSUITES_TLSV13_METHODDEF
_SSL__SSLCONTEXT__SET_ALPN_PROTOCOLS_METHODDEF
_SSL__SSLCONTEXT_LOAD_CERT_CHAIN_METHODDEF
_SSL__SSLCONTEXT_LOAD_DH_PARAMS_METHODDEF
Expand Down
40 changes: 40 additions & 0 deletions Modules/clinic/_ssl.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.