<< " is missing or empty: all or none of"
<< " TLS parameters must be set");
}
+ TlsRole tls_role = TlsRole::CLIENT;
+ // The peer entry for myself will be used for the server side.
+ if (p->second->getName() == getThisServerName()) {
+ tls_role = TlsRole::SERVER;
+ }
TlsContext::configure(p->second->tls_context_,
- TlsRole::CLIENT,
+ tls_role,
ca.get(),
cert.get(),
key.get());
// Fetch how many threads the listener will use.
uint32_t listener_threads = config_->getHttpListenerThreads();
+ // Fetch the TLS context.
+ auto tls_context = config_->getThisServerConfig()->getTlsContext();
+
// Instantiate the listener.
listener_.reset(new CmdHttpListener(server_address, my_url.getPort(),
- listener_threads));
+ listener_threads, tls_context));
}
}