[icinga-checkins] icinga.org: icinga2/support/2.4: Ensure to clear the SSL error queue before calling SSL_{read, write, do_handshake}

git at icinga.org git at icinga.org
Wed Aug 3 15:43:22 CEST 2016


Module: icinga2
Branch: support/2.4
Commit: ca73432181165333e3f549c6d3b5f89f000e2bd5
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=ca73432181165333e3f549c6d3b5f89f000e2bd5

Author: Michael Friedrich <michael.friedrich at netways.de>
Date:   Tue Jul  5 15:25:02 2016 +0200

Ensure to clear the SSL error queue before calling SSL_{read,write,do_handshake}

fixes #12100

---

 lib/base/tlsstream.cpp |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lib/base/tlsstream.cpp b/lib/base/tlsstream.cpp
index c4074ea..e1470bb 100644
--- a/lib/base/tlsstream.cpp
+++ b/lib/base/tlsstream.cpp
@@ -149,6 +149,11 @@ void TlsStream::OnEvent(int revents)
 
 	bool success = false;
 
+	/* Clear error queue for this thread before using SSL_{read,write,do_handshake}.
+	 * Otherwise SSL_*_error() does not work reliably.
+	 */
+	ERR_clear_error();
+
 	switch (m_CurrentAction) {
 		case TlsActionRead:
 			do {



More information about the icinga-checkins mailing list