summaryrefslogtreecommitdiffhomepage
path: root/https.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'https.cpp')
-rw-r--r--https.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/https.cpp b/https.cpp
index 508ece9..a5aa118 100644
--- a/https.cpp
+++ b/https.cpp
@@ -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);
}
}
}