Move OpenSSL uninitialization to a separate function
authorJoel Goguen <jgoguen@fb.com>
Wed, 1 Apr 2015 15:11:44 +0000 (08:11 -0700)
committerafrind <afrind@fb.com>
Thu, 2 Apr 2015 19:02:01 +0000 (12:02 -0700)
commit3fc4180172fb801a2be7522fe64a0f7746ce71b3
tree0bc063fcc248f03f6ec54aff7c85dd522a00eec8
parent75ad72b01bff0373837bb14fb83a201dc9fc5a1a
Move OpenSSL uninitialization to a separate function

Summary:
The current behaviour of SSLContext is subject to a bug where an instance going
out of scope at the wrong time can decrement the global refcount to 0, causing
the destructor to destroy the SSL context. Instead, this requires callers to
explicitly uninitialize the SSLContext instance and assume the risk of wrongly
destroying the global SSL context.

Test Plan:
Tested with mcrouter

Reviewed By: subodh@fb.com

Subscribers: afrind, ssl-diffs@, folly-diffs@, yfeldblum, chalfant, dihde, melitam

FB internal diff: D1949649

Tasks: 6358211

Signature: t1:1949649:1427854689:aea2dc801f63256ff64188b0f7a15121dcecee69
folly/io/async/SSLContext.cpp
folly/io/async/SSLContext.h