diff options
author | Roland Reichwein <mail@reichwein.it> | 2023-01-12 15:30:07 +0100 |
---|---|---|
committer | Roland Reichwein <mail@reichwein.it> | 2023-01-12 15:30:07 +0100 |
commit | 00ed7df1a09cad8862f2c586347f4f55c99681e5 (patch) | |
tree | e24ef2699affc7630ea42e728e62df7c6686f714 /https.h | |
parent | 3cb78411178f8458f889975799060e0bb866d2cf (diff) |
Consolidate HTTP+HTTPS via CRTP
Diffstat (limited to 'https.h')
-rw-r--r-- | https.h | 27 |
1 files changed, 4 insertions, 23 deletions
@@ -15,27 +15,8 @@ #include "config.h" #include "server.h" -namespace ssl = boost::asio::ssl; // from <boost/asio/ssl.hpp> +// 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<std::string, std::shared_ptr<ssl::context>> 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); |