mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
bpo-43577: Fix deadlock with SSLContext._msg_callback and sni_callback (GH-24957)
OpenSSL copies the internal message callback from SSL_CTX->msg_callback to SSL->msg_callback. SSL_set_SSL_CTX() does not update SSL->msg_callback to use the callback value of the new context. PySSL_set_context() now resets the callback and _PySSL_msg_callback() resets thread state in error path. Signed-off-by: Christian Heimes <christian@python.org>
This commit is contained in:
parent
20a5b7e986
commit
77cde5042a
4 changed files with 29 additions and 0 deletions
|
|
@ -23,6 +23,7 @@ _PySSL_msg_callback(int write_p, int version, int content_type,
|
|||
ssl_obj = (PySSLSocket *)SSL_get_app_data(ssl);
|
||||
assert(PySSLSocket_Check(ssl_obj));
|
||||
if (ssl_obj->ctx->msg_cb == NULL) {
|
||||
PyGILState_Release(threadstate);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue