diff options
author | Roland Reichwein <mail@reichwein.it> | 2020-05-15 18:59:19 +0200 |
---|---|---|
committer | Roland Reichwein <mail@reichwein.it> | 2020-05-15 18:59:19 +0200 |
commit | 48908fb0bba69404dfd86d1af3b9ace1e0d598c9 (patch) | |
tree | e8b60f5dcb692d1840e9c948b92689c1c3c0c284 /https.cpp | |
parent | 2a3c27aadee91cd7b179e762ef0fe99128345bd1 (diff) |
Speedup GetPath()
Diffstat (limited to 'https.cpp')
-rw-r--r-- | https.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -660,15 +660,15 @@ void Server::load_certificates() // import the real certificates for (const auto& serve_site: m_socket.serve_sites) { for (const auto& site: m_config.Sites()) { - if (site.name == serve_site) { + if (site.first == serve_site) { std::shared_ptr<ssl::context> ctx {std::make_shared<ssl::context>(tls_method)}; std::cout << "Creating SSL context/cert for site " << serve_site << " on port " << m_socket.port << std::endl; - load_server_certificate(*ctx, site.cert_path, site.key_path); + load_server_certificate(*ctx, site.second.cert_path, site.second.key_path); SSL_CTX_set_client_hello_cb(ctx->native_handle(), servername_callback, &m_ctx); - for (const auto& host: site.hosts) { + for (const auto& host: site.second.hosts) { std::cout << " Adding Host " << host << std::endl; m_ctx.emplace(host, ctx); } @@ -681,19 +681,19 @@ void Server::reload_certificates() { for (const auto& serve_site: m_socket.serve_sites) { for (const auto& site: m_config.Sites()) { - if (site.name == serve_site) { + if (site.first == serve_site) { std::cout << "Updating SSL context/cert for site " << serve_site << " on port " << m_socket.port << std::endl; - auto it_host {site.hosts.begin()}; - if (it_host == site.hosts.end()) { + auto it_host {site.second.hosts.begin()}; + if (it_host == site.second.hosts.end()) { std::cout << " Warning: No configured host found." << std::endl; } else { auto it_ctx {m_ctx.find(*it_host)}; if (it_ctx == m_ctx.end()) { std::cout << " Warning: No context found for configured host." << std::endl; } else { - load_server_certificate(*it_ctx->second, site.cert_path, site.key_path); + load_server_certificate(*it_ctx->second, site.second.cert_path, site.second.key_path); } } } |