summaryrefslogtreecommitdiffhomepage
path: root/https.h
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2020-04-05 14:22:31 +0200
committerRoland Reichwein <mail@reichwein.it>2020-04-05 14:22:31 +0200
commite234229ae80da0fa9967b797f7b5f4f381cba4b4 (patch)
tree02bed359b39eb1e8b7f022afb6fdba451292b5c6 /https.h
parent918685c1c09de1e3cd14c41bb8cc8b89a177ccd2 (diff)
All certificates configurable per site
Diffstat (limited to 'https.h')
-rw-r--r--https.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/https.h b/https.h
index 13a67a7..e009b78 100644
--- a/https.h
+++ b/https.h
@@ -1,5 +1,9 @@
#pragma once
+#include <memory>
+#include <string>
+#include <unordered_map>
+
#include <boost/asio/dispatch.hpp>
#include <boost/asio/strand.hpp>
#include <boost/beast/ssl.hpp>
@@ -12,12 +16,17 @@ 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
{
- // The SSL context is required, and holds certificates
public:
- ssl::context m_ctx{ssl::context::tlsv13};
- ssl::context m_ctx2{ssl::context::tlsv13};
+ 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)
+
const Socket& m_socket;
public: