[issue43577] Deadlock when using SSLContext._msg_callback and SSLContext.sni_callback

2021-03-21 Thread Christian Heimes
Christian Heimes added the comment: The fix will be available in next 3.9 and 3.8 release. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10 ___ Python tracker

[issue43577] Deadlock when using SSLContext._msg_callback and SSLContext.sni_callback

2021-03-21 Thread miss-islington
miss-islington added the comment: New changeset c145c03281af850130dd7f75abc19c6ea49626e6 by Miss Islington (bot) in branch '3.9': bpo-43577: Fix deadlock with SSLContext._msg_callback and sni_callback (GH-24957)

[issue43577] Deadlock when using SSLContext._msg_callback and SSLContext.sni_callback

2021-03-21 Thread Christian Heimes
Christian Heimes added the comment: No, there is no check for that. This kind of deadlock should never occur. The problem was an implementation bug in low-level C code that had bad interaction with the global interpreter lock. Python releases the GIL around OpenSSL calls. Callbacks have to

[issue43577] Deadlock when using SSLContext._msg_callback and SSLContext.sni_callback

2021-03-21 Thread miss-islington
miss-islington added the comment: New changeset 93b0da7527ae1b7d705052cf352ef9da81e608ec by Miss Islington (bot) in branch '3.8': bpo-43577: Fix deadlock with SSLContext._msg_callback and sni_callback (GH-24957)

[issue43577] Deadlock when using SSLContext._msg_callback and SSLContext.sni_callback

2021-03-21 Thread miss-islington
Change by miss-islington : -- pull_requests: +23717 pull_request: https://github.com/python/cpython/pull/24959 ___ Python tracker ___

[issue43577] Deadlock when using SSLContext._msg_callback and SSLContext.sni_callback

2021-03-21 Thread Christian Heimes
Christian Heimes added the comment: New changeset 77cde5042a2f1eae489c11a67540afaf43cd5cdf by Christian Heimes in branch 'master': bpo-43577: Fix deadlock with SSLContext._msg_callback and sni_callback (GH-24957)

[issue43577] Deadlock when using SSLContext._msg_callback and SSLContext.sni_callback

2021-03-21 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +23716 pull_request: https://github.com/python/cpython/pull/24958 ___ Python tracker

[issue43577] Deadlock when using SSLContext._msg_callback and SSLContext.sni_callback

2021-03-21 Thread Andrew Dailey
Andrew Dailey added the comment: I'm glad that the info I provided was helpful! I'll go ahead and create another issue for the misleading docs surrounding SSLContext.sni_callback. Thanks for looking into this and coming up with a fix so quickly. I do have one more question: does python

[issue43577] Deadlock when using SSLContext._msg_callback and SSLContext.sni_callback

2021-03-21 Thread Christian Heimes
Christian Heimes added the comment: Thanks for the excellent bug report and reproducer! I have identified the issue and submitted a fix for review. OpenSSL copies the internal msg_callback to SSL struct, but SSL_set_SSL_CTX() does not update the msg_callback with value from new context.

[issue43577] Deadlock when using SSLContext._msg_callback and SSLContext.sni_callback

2021-03-21 Thread Christian Heimes
Change by Christian Heimes : -- keywords: +patch pull_requests: +23715 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24957 ___ Python tracker

[issue43577] Deadlock when using SSLContext._msg_callback and SSLContext.sni_callback

2021-03-20 Thread Andrew Dailey
New submission from Andrew Dailey : Hello, I think I might've stumbled onto an oversight with how an SSLSocket handles overwriting its SSLContext within an sni_callback. If both "_msg_callback" and "sni_callback" are defined on an SSLContext object and the sni_callback replaces the context