summaryrefslogtreecommitdiffhomepage
path: root/https.h
blob: 1362e59f012766a19e4ea252096987a851052c4c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#pragma once

#include <memory>
#include <string>
#include <unordered_map>

#include <boost/asio/dispatch.hpp>
#include <boost/asio/strand.hpp>
#include <boost/beast/ssl.hpp>
#include <boost/asio/ssl.hpp>

#include "config.h"
#include "server.h"

namespace ssl = boost::asio::ssl;       // from <boost/asio/ssl.hpp>

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;
 ssl::context m_ctx_dummy{tls_method}; // Initial use, will be replaced by host specific context (with specific certificate)
 
public:
 Server(Config& config, boost::asio::io_context& ioc, const Socket& socket, plugins_container_type& plugins);
 virtual ~Server();

 int start() override;
};

}