Skip to content

Commit

Permalink
Give ownership of new session callbacks to SSLContext
Browse files Browse the repository at this point in the history
Summary: Giving SSLContext ownership over the new session callback attached to SSL_CTX, so that it may do additional work with the new session (i.e. forward the session to its corresponding abstracted SSLSession).

Reviewed By: yfeldblum

Differential Revision: D21021333

fbshipit-source-id: f1dc8bd17150d45498ae1c22ef4eed1d2ca00c01
  • Loading branch information
anhuang authored and facebook-github-bot committed May 5, 2020
1 parent 47bfc3c commit 11f49c1
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions mcrouter/lib/network/ThreadLocalSSLContextProvider.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

namespace folly {
class SSLContext;
} // folly
} // namespace folly

namespace facebook {
namespace memcache {
Expand All @@ -30,12 +30,11 @@ class ClientSSLContext : public folly::SSLContext {
public:
explicit ClientSSLContext(wangle::SSLSessionCallbacks& cache)
: cache_(cache) {
wangle::SSLSessionCallbacks::attachCallbacksToContext(getSSLCtx(), &cache_);
wangle::SSLSessionCallbacks::attachCallbacksToContext(this, &cache_);
}

virtual ~ClientSSLContext() override {
wangle::SSLSessionCallbacks::detachCallbacksFromContext(
getSSLCtx(), &cache_);
wangle::SSLSessionCallbacks::detachCallbacksFromContext(this, &cache_);
}

wangle::SSLSessionCallbacks& getCache() {
Expand Down Expand Up @@ -87,5 +86,5 @@ ServerContextPair getServerContexts(
folly::Optional<wangle::TLSTicketKeySeeds> seeds,
bool preferOcbCipher = false);

} // memcache
} // facebook
} // namespace memcache
} // namespace facebook

0 comments on commit 11f49c1

Please sign in to comment.