Digging around the internet for a few hours I could not find an answer to my question.
My model is this: I have one shared boost::asio::ssl::context
that is being used to create instances of boost::asio::ssl::stream
. Then stream objects are passed along to different threads.
Is this model thread safe? Can same boost::asio::ssl::context
be used in construction of different SSL stream objects that will be concurrently used?
Please, before marking this issue as a duplicate, consider reading description carefully. Thank you!
I my specific case, no objects are shared betweed threads. So anything said in Boost.Asio SSL thread safety thread safety does not affect my case. I access boost::asio::ssl::context
from a single thread.
Because SSL contexts needs to be shared among SSL sessions (otherwise, how would session resumption work) the SSL context class is fully, internally thread safe. You can use an SSL context in multiple SSL connections and from multiple threads however you want.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With