13 :
SslServer(evm, boost::asio::ssl::context::tlsv12_server,
14 config.ssl_enabled, false), dscp_value_(dscp) {
19 boost::asio::ssl::context *ctx =
context();
20 boost::system::error_code ec;
23 ctx->set_options(boost::asio::ssl::context::default_workarounds |
24 boost::asio::ssl::context::no_sslv3 |
25 boost::asio::ssl::context::no_sslv2 |
26 boost::asio::ssl::context::no_tlsv1 |
27 boost::asio::ssl::context::no_tlsv1_1, ec);
28 if (ec.value() != 0) {
34 std::string ca_cert_filename = config.
ca_cert;
36 if (!ca_cert_filename.empty() && !insecure) {
39 ctx->set_verify_mode(boost::asio::ssl::verify_peer |
40 boost::asio::ssl::verify_fail_if_no_peer_cert, ec);
41 if (ec.value() != 0) {
45 ctx->load_verify_file(ca_cert_filename, ec);
46 if (ec.value() != 0) {
52 ctx->use_certificate_file(config.
certfile,
53 boost::asio::ssl::context::pem, ec);
54 if (ec.value() != 0) {
59 ctx->use_private_key_file(config.
keyfile,
60 boost::asio::ssl::context::pem, ec);
61 if (ec.value() != 0) {
78 boost::system::error_code err;
boost::asio::ssl::context * context()
boost::function< void(HttpSession *session, const HttpRequest *)> HttpHandlerFn
HttpServer(EventManager *evm, const SslConfig &config=SslConfig(), uint8_t dscp=0)
boost::asio::ssl::stream< boost::asio::ip::tcp::socket > SslSocket
virtual SslSession * AllocSession(SslSocket *socket)
HttpHandlerFn GetHandler(const std::string &path)
#define HTTP_WILDCARD_ENTRY
void UpdateDscp(uint8_t value)
int SetListenSocketDscp(uint8_t value)
int SetDscpSocketOption(uint8_t value)
HandlerTrie http_handlers_
virtual bool AcceptSession(SslSession *session)
void RegisterHandler(const std::string &path, HttpHandlerFn handler)
virtual boost::system::error_code SetSocketOptions()