From d21bbaa281259a2fa4658cbcf5898f223a1547c4 Mon Sep 17 00:00:00 2001 From: neru Date: Wed, 13 May 2026 11:43:06 -0300 Subject: [PATCH] fix: use sslWriteAll --- src/proxy/tinymitm/proxy.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/proxy/tinymitm/proxy.cpp b/src/proxy/tinymitm/proxy.cpp index b11f78c..51fcfcd 100644 --- a/src/proxy/tinymitm/proxy.cpp +++ b/src/proxy/tinymitm/proxy.cpp @@ -530,8 +530,9 @@ void TinyMITMProxy::handleClient(SOCKET clientSocket) headers.insert(headers.size() - 2, "Content-Length: " + std::to_string(fullBody.size()) + "\r\n"); - if (wolfSSL_write(remoteSSL.get(), headers.data(), (int)headers.size()) <= 0) break; - if (wolfSSL_write(remoteSSL.get(), fullBody.data(), (int)fullBody.size()) <= 0) break; + std::string packet = headers + fullBody; + if (!sslWriteAll(remoteSSL.get(), packet.data(), (int)packet.size(), remoteGuard)) + break; } clientStream.buffer.erase(0, totalRequestSize);