Skip to content

Commit c837f6d

Browse files
Kyle Nekritzfacebook-github-bot
authored andcommitted
Add option to disable sending NewSessionTickets to Fizz server
Summary: This change adds a command-line option `-no_session_tickets` to the Fizz server tool that allows disabling automatic sending of NewSessionTickets after a handshake is completed. The Fizz server context already had built-in support for this functionality via the `setSendNewSessionTicket(false)` method, but there was no way to access this from the command line. This change exposes this functionality to users of the tool. Reviewed By: ngoyal Differential Revision: D78039425 fbshipit-source-id: 7c9649cb4aa59103ee4b1602cc316e33ffb4e093
1 parent e2ccd12 commit c837f6d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

fizz/tool/FizzServerCommand.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ void printUsage() {
7979
<< " -vmodule m1=N,... (set per-module verbose log level for VLOG macros. Default: none)\n"
8080
<< " -http (run a crude HTTP server that returns stats for GET requests. Default: false)\n"
8181
<< " -delegatedcred cred (use a delegated credential. If set, -cert and -key must also be set. Default: none)\n"
82+
<< " -no_session_tickets (disable sending session tickets after handshake. Default: false)\n"
8283
<< " -ech (use default values to simulate the sending of an encrypted client hello.)\n"
8384
<< " -echconfigs file (path to read ECH configs to use when decrypting an encrypted client hello.)\n"
8485
<< " (If more than 1 ECH config is provided, the first config will be used.)\n"
@@ -672,6 +673,7 @@ int fizzServerCommand(const std::vector<std::string>& args) {
672673
bool ech = false;
673674
std::string echConfigsFile;
674675
std::string echPrivateKeyFile;
676+
bool noSessionTickets = false;
675677
bool uring = false;
676678
bool uringAsync = false;
677679
bool uringRegisterFds = false;
@@ -745,6 +747,9 @@ int fizzServerCommand(const std::vector<std::string>& args) {
745747
{"-delegatedcred", {true, [&credPath](const std::string& arg) {
746748
credPath = arg;
747749
}}},
750+
{"-no_session_tickets", {false, [&noSessionTickets](const std::string&) {
751+
noSessionTickets = true;
752+
}}},
748753
{"-ech", {false, [&ech](const std::string&) {
749754
ech = true;
750755
}}},
@@ -1161,6 +1166,11 @@ int fizzServerCommand(const std::vector<std::string>& args) {
11611166

11621167
serverContext->setSupportedVersions(
11631168
{ProtocolVersion::tls_1_3, ProtocolVersion::tls_1_3_28});
1169+
1170+
if (noSessionTickets) {
1171+
serverContext->setSendNewSessionTicket(false);
1172+
}
1173+
11641174
FizzServerAcceptor acceptor(
11651175
port, serverContext, loop, &evb, sslContext, uringAsync);
11661176
if (!keyLogFile.empty()) {

0 commit comments

Comments
 (0)