27 std::shared_ptr<AsyncFizzServer> server) = 0;
34 std::vector<folly::ssl::X509UniquePtr> certChain;
35 certChain.push_back(
std::move(certData.cert));
36 auto fizzCert = std::make_unique<SelfCertImpl<KeyType::P256>>(
38 auto certManager = std::make_unique<CertManager>();
39 certManager->addCert(
std::move(fizzCert),
true);
40 ctx_ = std::make_shared<FizzServerContext>();
55 LOG(ERROR) <<
"Accept error: " << ex.what();
65 transport->accept(callback);
75 ticketCipher->setTicketSecrets({{
folly::range(ticketSeed)}});
76 ctx_->setTicketCipher(ticketCipher);
78 ctx_->setTicketCipher(
nullptr);
83 auto certManager = std::make_unique<CertManager>();
84 certManager->addCert(
std::move(cert),
true);
96 auto clientAuthCerts =
100 for (
auto& caCert : clientAuthCerts) {
101 if (X509_STORE_add_cert(store.get(), caCert.get()) != 1) {
102 auto err = ERR_get_error();
104 ERR_GET_LIB(err) == ERR_LIB_X509 &&
105 ERR_GET_REASON(err) == X509_R_CERT_ALREADY_IN_HASH_TABLE)
106 <<
"Could not insert CA certificate into store: " 111 auto verifier = std::make_shared<DefaultCertificateVerifier>(
118 ctx_->setClientCertVerifier(
nullptr);
123 ctx_->setEarlyDataSettings(
125 {std::chrono::seconds(-10), std::chrono::seconds(10)},
126 std::make_shared<AllowAllReplayReplayCache>());
148 std::shared_ptr<FizzServerContext>
ctx_;
std::shared_ptr< FizzServerContext > getFizzContext()
folly::AsyncServerSocket::UniquePtr socket_
bool readFile(int fd, Container &out, size_t num_bytes=std::numeric_limits< size_t >::max())
void setResumption(bool enable)
CallbackFactory * factory_
constexpr detail::Map< Move > move
virtual AsyncFizzServer::HandshakeCallback * getCallback(std::shared_ptr< AsyncFizzServer > server)=0
requires E e noexcept(noexcept(s.error(std::move(e))))
folly::SocketAddress getAddress()
void connectionAccepted(int fd, const folly::SocketAddress &) noexceptoverride
folly::Optional< PskKeyExchangeMode > mode
std::unique_ptr< X509_STORE, X509StoreDeleter > X509StoreUniquePtr
constexpr Range< Iter > range(Iter first, Iter last)
std::shared_ptr< FizzServerContext > ctx_
void setFizzContext(std::shared_ptr< FizzServerContext > ctx)
void setAcceptEarlyData(bool enable)
void acceptError(const std::exception &ex) noexceptoverride
void setCertificate(std::unique_ptr< SelfCert > cert)
std::unique_ptr< AsyncServerSocket, Destructor > UniquePtr
std::unique_ptr< AsyncFizzServerT, folly::DelayedDestruction::Destructor > UniquePtr
CertAndKey createCert(std::string cn, bool ca, CertAndKey *issuer)
Range< const unsigned char * > ByteRange
static std::vector< X509UniquePtr > readCertsFromBuffer(ByteRange range)
AsyncFizzServerT< ServerStateMachine > AsyncFizzServer
FizzTestServer(folly::EventBase &evb, CallbackFactory *factory, int port=0)
void enableClientAuthWithChain(std::string path, ClientAuthMode mode=ClientAuthMode::Optional)
ThreadPoolListHook * addr
virtual ~CallbackFactory()=default
std::unique_ptr< AsyncSocket, Destructor > UniquePtr