I have a tool which executes an HTTPS POST command against the same URL with same headers, same post body, etc. for a number of iterations.
What I have run into is that for some testers, every so often the WinHttpSendRequest() function fails and the subsequent call to GetLastError() returns SEC_E_BUFFER_TOO_SMALL (0x80090321) documented here: COM Error Codes (Security and Setup).
This is not a documented error code for WinHttpSendRequest() and fairly extensive Googling has not turned up anything at all for this.
I have quadruple checked that the inputs I am providing WinHttpSendRequest() are correct and valid, and those inputs work tens of thousands of times in a row... until it doesn't.
I cannot provide a MVCE, but under the assumptions provided here, Im looking for any possible reason for the error code coming back.