diff --git a/net/SslSocket.hpp b/net/SslSocket.hpp index 151c5d3524031..57cb55669cd21 100644 --- a/net/SslSocket.hpp +++ b/net/SslSocket.hpp @@ -16,6 +16,7 @@ #include #include +#include #include #include @@ -313,6 +314,8 @@ class SslStreamSocket final : public StreamSocket const int ret = handleSslError(rc, last_errno, context); errno = last_errno; // Restore errno. + ERR_clear_error(); // Make sure we leave no errors in the queue. + return ret; }