summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_ssl.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_ssl.py')
-rw-r--r--Lib/test/test_ssl.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
index ade7ef5..bed0d41 100644
--- a/Lib/test/test_ssl.py
+++ b/Lib/test/test_ssl.py
@@ -4764,6 +4764,28 @@ class TestSSLDebug(unittest.TestCase):
msg
)
+ def test_msg_callback_deadlock_bpo43577(self):
+ client_context, server_context, hostname = testing_context()
+ server_context2 = testing_context()[1]
+
+ def msg_cb(conn, direction, version, content_type, msg_type, data):
+ pass
+
+ def sni_cb(sock, servername, ctx):
+ sock.context = server_context2
+
+ server_context._msg_callback = msg_cb
+ server_context.sni_callback = sni_cb
+
+ server = ThreadedEchoServer(context=server_context, chatty=False)
+ with server:
+ with client_context.wrap_socket(socket.socket(),
+ server_hostname=hostname) as s:
+ s.connect((HOST, server.port))
+ with client_context.wrap_socket(socket.socket(),
+ server_hostname=hostname) as s:
+ s.connect((HOST, server.port))
+
def test_main(verbose=False):
if support.verbose: