Christian Heimes <li...@cheimes.de> added the comment:

The demo script uses the same connection socket in two threads. Neither OpenSSL 
nor Python guarantee that a single SSLSocket object can be used by multiple 
threads. https://www.openssl.org/blog/blog/2017/02/21/threads/ contains more 
information about thread safety.

tl;dr SSLObject and SSLSocket cannot be safely used by multiple threads at the 
same time. SSLContext can be shared across multiple threads. However it's not 
safe to reconfigure a context once it's attached to a connection. Only getters, 
wrap_*(), and load_verify_locations() are safe.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue33090>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to