Printing eror message on ssl init failed

This commit is contained in:
WolverinDEV 2020-03-02 20:22:11 +01:00
parent 8de9bc921f
commit 67becd9496
1 changed files with 3 additions and 2 deletions

View File

@ -197,14 +197,15 @@ void WebStatistics::initialize_client(const std::shared_ptr<license::web::WebSta
});
{
std::string error{};
auto options = make_shared<pipes::SSL::Options>();
options->type = pipes::SSL::SERVER;
options->context_method = TLS_method();
options->free_unused_keypairs = false; /* we dont want our keys get removed */
options->default_keypair({this->ssl->privateKey, this->ssl->certificate});
if(!client->pipe_ssl->initialize(options)) {
logError(LOG_LICENSE_WEB, "[{}][SSL] Failed to setup ssl! Disconnecting client", client->client_prefix());
if(!client->pipe_ssl->initialize(options, error)) {
logError(LOG_LICENSE_WEB, "[{}][SSL] Failed to setup ssl ({})! Disconnecting client", client->client_prefix(), error);
this->close_connection(client);
}
}