mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-19 19:54:34 +02:00
parent
06052c0539
commit
28d7051aed
@ -139,7 +139,7 @@ void TlsStream::Handshake(void)
|
|||||||
} catch (const std::exception&) {}
|
} catch (const std::exception&) {}
|
||||||
continue;
|
continue;
|
||||||
case SSL_ERROR_ZERO_RETURN:
|
case SSL_ERROR_ZERO_RETURN:
|
||||||
Close();
|
CloseUnlocked();
|
||||||
return;
|
return;
|
||||||
default:
|
default:
|
||||||
msgbuf << "SSL_do_handshake() failed with code " << ERR_peek_error() << ", \"" << ERR_error_string(ERR_peek_error(), errbuf) << "\"";
|
msgbuf << "SSL_do_handshake() failed with code " << ERR_peek_error() << ", \"" << ERR_error_string(ERR_peek_error(), errbuf) << "\"";
|
||||||
@ -197,7 +197,7 @@ size_t TlsStream::Read(void *buffer, size_t count)
|
|||||||
} catch (const std::exception&) {}
|
} catch (const std::exception&) {}
|
||||||
continue;
|
continue;
|
||||||
case SSL_ERROR_ZERO_RETURN:
|
case SSL_ERROR_ZERO_RETURN:
|
||||||
Close();
|
CloseUnlocked();
|
||||||
return count - left;
|
return count - left;
|
||||||
default:
|
default:
|
||||||
if (ERR_peek_error() != 0) {
|
if (ERR_peek_error() != 0) {
|
||||||
@ -251,7 +251,7 @@ void TlsStream::Write(const void *buffer, size_t count)
|
|||||||
} catch (const std::exception&) {}
|
} catch (const std::exception&) {}
|
||||||
continue;
|
continue;
|
||||||
case SSL_ERROR_ZERO_RETURN:
|
case SSL_ERROR_ZERO_RETURN:
|
||||||
Close();
|
CloseUnlocked();
|
||||||
return;
|
return;
|
||||||
default:
|
default:
|
||||||
if (ERR_peek_error() != 0) {
|
if (ERR_peek_error() != 0) {
|
||||||
@ -276,6 +276,11 @@ void TlsStream::Close(void)
|
|||||||
{
|
{
|
||||||
boost::mutex::scoped_lock alock(m_IOActionLock);
|
boost::mutex::scoped_lock alock(m_IOActionLock);
|
||||||
|
|
||||||
|
CloseUnlocked();
|
||||||
|
}
|
||||||
|
|
||||||
|
void TlsStream::CloseUnlocked(void)
|
||||||
|
{
|
||||||
m_Eof = true;
|
m_Eof = true;
|
||||||
|
|
||||||
for (int i = 0; i < 5; i++) {
|
for (int i = 0; i < 5; i++) {
|
||||||
|
@ -67,6 +67,8 @@ private:
|
|||||||
static int m_SSLIndex;
|
static int m_SSLIndex;
|
||||||
static bool m_SSLIndexInitialized;
|
static bool m_SSLIndexInitialized;
|
||||||
|
|
||||||
|
void CloseUnlocked(void);
|
||||||
|
|
||||||
static int ValidateCertificate(int preverify_ok, X509_STORE_CTX *ctx);
|
static int ValidateCertificate(int preverify_ok, X509_STORE_CTX *ctx);
|
||||||
static void NullCertificateDeleter(X509 *certificate);
|
static void NullCertificateDeleter(X509 *certificate);
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user