diff options
author | Roland Reichwein <mail@reichwein.it> | 2020-04-05 14:22:31 +0200 |
---|---|---|
committer | Roland Reichwein <mail@reichwein.it> | 2020-04-05 14:22:31 +0200 |
commit | e234229ae80da0fa9967b797f7b5f4f381cba4b4 (patch) | |
tree | 02bed359b39eb1e8b7f022afb6fdba451292b5c6 /https.h | |
parent | 918685c1c09de1e3cd14c41bb8cc8b89a177ccd2 (diff) |
All certificates configurable per site
Diffstat (limited to 'https.h')
-rw-r--r-- | https.h | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -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: |