diff --git a/net/SslSocket.hpp b/net/SslSocket.hpp index 57cb55669cd21..3add56f6403cc 100644 --- a/net/SslSocket.hpp +++ b/net/SslSocket.hpp @@ -305,6 +305,16 @@ class SslStreamSocket final : public StreamSocket if (rc > 0) { + const unsigned long bioError = ERR_peek_error(); + if (bioError != 0) + { + LOG_DBG("Unexpected SSL error (" + << bioError + << ") after success implies uncleared earlier errors or " + "a bug in the SSL library"); + ERR_clear_error(); + } + // Success: Reset so we can do either. _sslWantsTo = SslWantsTo::Neither; return rc;