MCPcopy Create free account
hub / github.com/chronoxor/CppServer / CreateContext

Method CreateContext

tests/test_ssl.cpp:94–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92 using SSLServer::SSLServer;
93
94 static std::shared_ptr<SSLContext> CreateContext()
95 {
96 auto context = std::make_shared<SSLContext>(asio::ssl::context::tlsv13);
97 context->set_password_callback([](size_t max_length, asio::ssl::context::password_purpose purpose) -> std::string { return "qwerty"; });
98 context->use_certificate_chain_file("../tools/certificates/server.pem");
99 context->use_private_key_file("../tools/certificates/server.pem", asio::ssl::context::pem);
100 context->use_tmp_dh_file("../tools/certificates/dh4096.pem");
101 return context;
102 }
103
104protected:
105 std::shared_ptr<SSLSession> CreateSession(const std::shared_ptr<SSLServer>& server) override { return std::make_shared<EchoSSLSession>(server); }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected