Skip to content

Commit

Permalink
Refactor uses of setClientCertificate to setClientCertManager
Browse files Browse the repository at this point in the history
Summary: use the new setClientCertManager method instead of the deprecated setClientCertificate method and remove it from FizzClientContext.h

Reviewed By: zxjtan

Differential Revision: D62404702

fbshipit-source-id: 936c19c31499558043e50027875143edebb4539c
  • Loading branch information
Abdulkadir Fiqi authored and facebook-github-bot committed Sep 16, 2024
1 parent 1148065 commit 376776a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion proxygen/httpclient/samples/httperf2/Client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,9 @@ void Client::setupFizzContext(std::shared_ptr<fizz::client::PskCache> pskCache,
folly::readFile(key.c_str(), keyData);
}
auto selfCert = fizz::openssl::CertUtils::makeSelfCert(certData, keyData);
fizzContext_->setClientCertificate(std::move(selfCert));
auto certMgr = std::make_shared<fizz::client::CertManager>();
certMgr->addCert(std::move(selfCert));
fizzContext_->setClientCertManager(std::move(certMgr));
}
}

Expand Down
4 changes: 3 additions & 1 deletion proxygen/httpserver/samples/hq/FizzContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,9 @@ FizzClientContextPtr createFizzClientContext(const HQBaseParams& params,
folly::readFile(params.keyFilePath.c_str(), keyData);
}
auto cert = fizz::openssl::CertUtils::makeSelfCert(certData, keyData);
ctx->setClientCertificate(std::move(cert));
auto certMgr = std::make_shared<fizz::client::CertManager>();
certMgr->addCert(std::move(cert));
ctx->setClientCertManager(std::move(certMgr));
ctx->setSupportedAlpns(params.supportedAlpns);
ctx->setDefaultShares(
{fizz::NamedGroup::x25519, fizz::NamedGroup::secp256r1});
Expand Down
4 changes: 3 additions & 1 deletion proxygen/lib/transport/H3DatagramAsyncSocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,9 @@ H3DatagramAsyncSocket::createFizzClientContext() {
std::string keyData;
folly::readFile(options_.certAndKey_->second.c_str(), keyData);
auto cert = fizz::openssl::CertUtils::makeSelfCert(certData, keyData);
ctx->setClientCertificate(std::move(cert));
auto certMgr = std::make_shared<fizz::client::CertManager>();
certMgr->addCert(std::move(cert));
ctx->setClientCertManager(std::move(certMgr));
}

std::vector<std::string> supportedAlpns = {proxygen::kH3FBCurrentDraft};
Expand Down

0 comments on commit 376776a

Please sign in to comment.