-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Http request failes due to WinHTTP error code 87 #2956
Comments
Turns out that the aws-sdk always calls WinHttpSendRequest with |
It looks like your using this in an untested way. When this was written they probably didn't expect it to be used this way. Looking into a possible fix for this |
@jmklix would you please elaborate on how this is being used in an unexpected way and if/how it should be used differently? |
What Joseph is referring to is that signers and http client wrappers are CPP SDK internal helper classes and we dont expect them to be used directly by majority of users, so they might not be as thoroughly tested to work with all sorts of input combinations. In this particular case, Windows doc does seem to imply that dwTotalLength is required (unless Transfer-Encoding: chunked is used). My guess for why its not a bigger issue is probably because SDK will add Content-Length manually after signing and WinHttpSendRequest will use that instead, somehow. |
@DmitriyMusatkin okay is there a different way to make a signed request that is recommended over this? What we are trying to do is make a request to an API Gateway endpoint that is using IAM authorization. We didn't find a built-in way to do this with the SDK. |
Hi, while I agree that SDK does not set the body size in WinHttpSendRequest, I'd suggest to check what payload is actually being read/sent to the remote here: WinSyncHttpClient::StreamPayloadToRequest, for example, by adding such trace before each
Additionally, please enable Another option would be try to use SDK built with libCurl on Windows. We can also check and provide an example how to make API Gateway calls using the SDK, however, we can't give any estimation here. Best regards, |
Greetings! It looks like this issue hasn’t been active in longer than a week. We encourage you to check if this is still an issue in the latest release. Because it has been longer than a week since the last update on this, and in the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or add an upvote to prevent automatic closure, or if the issue is already closed, please feel free to open a new one. |
Hi all, |
This issue is now closed. Comments on closed issues are hard for our team to see. |
Describe the bug
Sending a signed http request with content body (AddContentBody) fails.
The trace-log shows following suspicious error:
Send request failed: Windows/WinHTTP error code is 87:
I am able to send the request without setting the content body.
Therefore my assumption is that the content body stream might cause the issue, but i don't know how.
Expected Behavior
Sending an http request with content body should not fail.
Current Behavior
Sending an http request with content body fails with error Windows/WinHTTP error code is 87
Reproduction Steps
This is the way i set up sending the http request:
Possible Solution
No response
Additional Information/Context
This is the trace-log:
AWS CPP SDK version used
1.11.305
Compiler and Version used
Visual Studio Version 17.9.5
Operating System and version
Windows 10.0.19045
The text was updated successfully, but these errors were encountered: