summaryrefslogtreecommitdiffhomepage
path: root/https.h
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2023-01-12 15:30:07 +0100
committerRoland Reichwein <mail@reichwein.it>2023-01-12 15:30:07 +0100
commit00ed7df1a09cad8862f2c586347f4f55c99681e5 (patch)
treee24ef2699affc7630ea42e728e62df7c6686f714 /https.h
parent3cb78411178f8458f889975799060e0bb866d2cf (diff)
Consolidate HTTP+HTTPS via CRTP
Diffstat (limited to 'https.h')
-rw-r--r--https.h27
1 files changed, 4 insertions, 23 deletions
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 <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);