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

git at icinga.org git at icinga.org
Tue Jul 5 15:44:52 CEST 2016


Module: icinga2
Branch: master
Commit: 9b873d60c209c1950520b5823b2136a7f3c58b92
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=9b873d60c209c1950520b5823b2136a7f3c58b92

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