mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-25 22:54:57 +02:00
fixup errbuf length in the other files and avoid using the static buffer in one place (for thread safety and code consistency reasons)
This commit is contained in:
parent
e75f063552
commit
4c86c370bb
@ -61,7 +61,7 @@ TlsStream::TlsStream(const Socket::Ptr& socket, const String& hostname, Connecti
|
|||||||
m_CurrentAction(TlsActionNone), m_Retry(false), m_Shutdown(false)
|
m_CurrentAction(TlsActionNone), m_Retry(false), m_Shutdown(false)
|
||||||
{
|
{
|
||||||
std::ostringstream msgbuf;
|
std::ostringstream msgbuf;
|
||||||
char errbuf[120];
|
char errbuf[256];
|
||||||
|
|
||||||
m_SSL = std::shared_ptr<SSL>(SSL_new(sslContext), SSL_free);
|
m_SSL = std::shared_ptr<SSL>(SSL_new(sslContext), SSL_free);
|
||||||
|
|
||||||
@ -272,8 +272,9 @@ void TlsStream::OnEvent(int revents)
|
|||||||
m_ErrorOccurred = true;
|
m_ErrorOccurred = true;
|
||||||
|
|
||||||
if (m_ErrorCode != 0) {
|
if (m_ErrorCode != 0) {
|
||||||
|
char errbuf[256];
|
||||||
Log(LogWarning, "TlsStream")
|
Log(LogWarning, "TlsStream")
|
||||||
<< "OpenSSL error: " << ERR_error_string(m_ErrorCode, nullptr);
|
<< "OpenSSL error: " << ERR_error_string(m_ErrorCode, errbuf);
|
||||||
} else {
|
} else {
|
||||||
Log(LogWarning, "TlsStream", "TLS stream was disconnected.");
|
Log(LogWarning, "TlsStream", "TLS stream was disconnected.");
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,7 @@ int PkiUtility::NewCert(const String& cn, const String& keyfile, const String& c
|
|||||||
|
|
||||||
int PkiUtility::SignCsr(const String& csrfile, const String& certfile)
|
int PkiUtility::SignCsr(const String& csrfile, const String& certfile)
|
||||||
{
|
{
|
||||||
char errbuf[120];
|
char errbuf[256];
|
||||||
|
|
||||||
InitializeOpenSSL();
|
InitializeOpenSSL();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user