]> granicus.if.org Git - icinga2/commitdiff
Ensure to clear the SSL error queue before calling SSL_{read,write,do_handshake}
authorMichael Friedrich <michael.friedrich@netways.de>
Tue, 5 Jul 2016 13:25:02 +0000 (15:25 +0200)
committerMichael Friedrich <michael.friedrich@netways.de>
Tue, 5 Jul 2016 13:25:02 +0000 (15:25 +0200)
fixes #12100

lib/base/tlsstream.cpp

index c4074eaa0d32c1e8c48e4ddca7ebd9ce98b1e8da..e1470bb969b4fa8fe63b289e4f17866fb153da1f 100644 (file)
@@ -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 {