mirror of https://github.com/Icinga/icinga2.git
Merge pull request #6602 from Icinga/fix/improve-tls-handshake-exception-logging
Improve TLS handshake exception logging
This commit is contained in:
commit
c48da4c280
|
@ -434,7 +434,7 @@ void ElasticsearchWriter::SendRequest(const String& body)
|
|||
stream = Connect();
|
||||
} catch (const std::exception& ex) {
|
||||
Log(LogWarning, "ElasticsearchWriter")
|
||||
<< "Flush failed, cannot connect to Elasticsearch.";
|
||||
<< "Flush failed, cannot connect to Elasticsearch: " << DiagnosticInformation(ex, false);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -425,7 +425,7 @@ void InfluxdbWriter::Flush()
|
|||
stream = Connect();
|
||||
} catch (const std::exception& ex) {
|
||||
Log(LogWarning, "InfluxDbWriter")
|
||||
<< "Flush failed, cannot connect to InfluxDB.";
|
||||
<< "Flush failed, cannot connect to InfluxDB: " << DiagnosticInformation(ex, false);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -461,9 +461,9 @@ void ApiListener::NewClientHandlerInternal(const Socket::Ptr& client, const Stri
|
|||
|
||||
try {
|
||||
tlsStream->Handshake();
|
||||
} catch (const std::exception&) {
|
||||
} catch (const std::exception& ex) {
|
||||
Log(LogCritical, "ApiListener")
|
||||
<< "Client TLS handshake failed (" << conninfo << ")";
|
||||
<< "Client TLS handshake failed (" << conninfo << "): " << DiagnosticInformation(ex, false);
|
||||
tlsStream->Close();
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -187,8 +187,9 @@ int PkiUtility::RequestCertificate(const String& host, const String& port, const
|
|||
|
||||
try {
|
||||
stream->Handshake();
|
||||
} catch (const std::exception&) {
|
||||
Log(LogCritical, "cli", "Client TLS handshake failed.");
|
||||
} catch (const std::exception& ex) {
|
||||
Log(LogCritical, "cli")
|
||||
<< "Client TLS handshake failed: " << DiagnosticInformation(ex, false);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#define PKIUTILITY_H
|
||||
|
||||
#include "remote/i2-remote.hpp"
|
||||
#include "base/exception.hpp"
|
||||
#include "base/dictionary.hpp"
|
||||
#include "base/string.hpp"
|
||||
#include <openssl/x509v3.h>
|
||||
|
|
Loading…
Reference in New Issue