Dear Martijn Otto,
Please, if it is not hard for you: make PR with documentation the
behaviour for the context.
--
regards
2019-09-29 22:11 GMT+05:00, Martijn Otto via Boost-users
On Sat, 2019-09-28 at 07:31 +0500, Dmitrij V via Boost-users wrote:
Martijn Otto wrote:
I could make a pull-request to implement these changes, if so desired.
+1, changes + documentation on its, please :)
Does this have any change of getting merged?
Oh, that is not in my authority, but please, send the PR into https://github.com/chriskohlhoff/asio too
-- regards _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org https://lists.boost.org/mailman/listinfo.cgi/boost-users
After reading through the source code some more, it seems that no changes are actually necessary, since my initial code was already safe. I'll explain why.
The ssl::stream constructor, which does get a reference to the ssl::context and extracts the underlying SSL_CTX but does not keep this in a member. Instead, it forwards it to its core_ member, which is an instance of detail::stream_core. detail::stream_core then forwards it to its engine_ member, which is an instance of detail::engine.
detail::engine then uses it to call SSL_new. The documentation for SSL_new does not explicitly mention it, but looking through the code I can see it call SSL_CTX_up_ref(), which increases the reference count on the underlying SSL_CTX, which means that even if the ssl_context calls SSL_CTX_free(), the context will remain valid if there is an ssl::stream using it.
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org https://lists.boost.org/mailman/listinfo.cgi/boost-users