Skip to content

Commit

Permalink
Enable requirement of ALPN negotiation in H3 datagram connector
Browse files Browse the repository at this point in the history
Summary:
H3DatagramAsyncSocket talks to fwdproxy through HTTP3 CONNECT-UDP tunnel. Both sides need to agree on a specific version of HTTP3 protocol. [Here](https://www.internalfb.com/code/fbsource/[7b9cbf3292c5]/fbcode/proxygen/lib/transport/H3DatagramAsyncSocket.cpp?lines=316-317) is the ALPN negotiation for that purpose. Since version mismatch will cause undefined behavior, I am enabling the requirement of ALPN negotiation.

By the way, I am also removing the code to set default shares per knekritz's suggestion. The client doesn't need to put multiple key shares in the client hello. The default ```x25519``` works as expected.

Differential Revision: D62574965

fbshipit-source-id: 5bc8f5fd27ddd9b10f6039bec1f5653ddd9d09ea
  • Loading branch information
Fred Qiu authored and facebook-github-bot committed Sep 12, 2024
1 parent b7adeab commit b87d460
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,7 @@ H3DatagramAsyncSocket::createFizzClientContext() {

std::vector<std::string> supportedAlpns = {proxygen::kH3FBCurrentDraft};
ctx->setSupportedAlpns(supportedAlpns);
ctx->setDefaultShares(
{fizz::NamedGroup::x25519, fizz::NamedGroup::secp256r1});
ctx->setRequireAlpn(true);
ctx->setSendEarlyData(false);
return ctx;
}
Expand Down

0 comments on commit b87d460

Please sign in to comment.