Skip to content

Commit

Permalink
Use const qualified ssl context
Browse files Browse the repository at this point in the history
Summary: Allow using const qualified ssl context. This avoids potential bugs due to sharing context among multiple connections.

Reviewed By: hanidamlaj

Differential Revision: D51874030

fbshipit-source-id: 61dfb1333085418ae729109be105e1991e42b4f2
  • Loading branch information
abakiaydin authored and facebook-github-bot committed Dec 7, 2023
1 parent 2bcbfd2 commit ec7de8a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions wangle/bootstrap/BaseClientBootstrap.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ class BaseClientBootstrap {
const folly::SocketAddress& address,
std::chrono::milliseconds timeout = std::chrono::milliseconds(0)) = 0;

BaseClientBootstrap* sslContext(folly::SSLContextPtr sslContext) {
BaseClientBootstrap* sslContext(
std::shared_ptr<const folly::SSLContext> sslContext) {
sslContext_ = sslContext;
return this;
}
Expand Down Expand Up @@ -139,7 +140,7 @@ class BaseClientBootstrap {

std::shared_ptr<PipelineFactory<P>> pipelineFactory_;
typename P::Ptr pipeline_;
folly::SSLContextPtr sslContext_;
std::shared_ptr<const folly::SSLContext> sslContext_;
std::shared_ptr<folly::ssl::SSLSession> sslSession_{nullptr};
std::string sni_;
bool deferSecurityNegotiation_{false};
Expand Down

0 comments on commit ec7de8a

Please sign in to comment.