From 00ed7df1a09cad8862f2c586347f4f55c99681e5 Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Thu, 12 Jan 2023 15:30:07 +0100 Subject: Consolidate HTTP+HTTPS via CRTP --- https.h | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) (limited to 'https.h') diff --git a/https.h b/https.h index 2a1caa8..226490e 100644 --- a/https.h +++ b/https.h @@ -15,27 +15,8 @@ #include "config.h" #include "server.h" -namespace ssl = boost::asio::ssl; // from +// plain / http +void make_listener(boost::asio::io_context& ioc, boost::asio::ip::address address, unsigned short port, Server& server); -namespace HTTPS { - -static const ssl::context_base::method tls_method {ssl::context::tlsv13}; - -class Server: public ::Server -{ -public: - typedef std::unordered_map> ctx_type; - -private: - ctx_type m_ctx; - -public: - Server(Config& config, boost::asio::io_context& ioc, const Socket& socket, plugins_container_type& plugins, Statistics& statistics); - virtual ~Server(); - - void load_certificates(); - - int start() override; -}; - -} +// ssl / https +void make_listener(boost::asio::io_context& ioc, boost::asio::ssl::context& ctx, boost::asio::ip::address address, unsigned short port, Server& server); -- cgit v1.2.3