diff --git a/src/shrpx.cc b/src/shrpx.cc index 184125f0..62c0abc0 100644 --- a/src/shrpx.cc +++ b/src/shrpx.cc @@ -1549,7 +1549,17 @@ void fill_default_config(Config *config) { } auto &quicconf = config->quic; - { quicconf.timeout.idle = 30_s; } + { + quicconf.timeout.idle = 30_s; + + auto &stateless_resetconf = quicconf.stateless_reset; + // TODO Find better place to do this and error handling. + if (RAND_bytes(stateless_resetconf.secret.data(), + stateless_resetconf.secret.size()) != 1) { + LOG(FATAL) << "Unable to generate stateless reset secret"; + exit(EXIT_FAILURE); + } + } auto &loggingconf = config->logging; {