Skip to content

Conversation

@troglodite2
Copy link

Fixes: #259

While s3.c: perform_request() is called with verb="PUT" libcurl sends a GET request.

Since the method of the call is part of the S3 authorization hashing, the hashes do not match causing a Signature Error.

libcurl's documentation says that a PUT will be done if the CURLOPT_UPLOAD, CURLOPT_READFUNCTION, and CURLOPT_READDATA are all set.

What the documentation does not say is that only one of CURLOPT_HTTPGET, CURLOPT_UPLOAD, CURLOPT_POST, or CURLOPT_NOBODY can be set. In our case, we set CURLOPT_UPLOAD correctly and then set POST and NOBODY (to zero).

This appears to reset the options to "none" which defaults to "GET" causing the GET instead of PUT.

Using C's shortcut feture on conditionals, we check if the option should be set before we set the option.

Fixes: zmanda#259

While s3.c: perform_request()  is called with verb="PUT" libcurl sends
a GET request.

Since the method of the call is part of the S3 authorization hashing,
the hashes do not match causing a Signature Error.

libcurl's documentation says that a PUT will be done if the
CURLOPT_UPLOAD, CURLOPT_READFUNCTION, and CURLOPT_READDATA are all set.

What the documentation does not say is that only one of CURLOPT_HTTPGET,
CURLOPT_UPLOAD, CURLOPT_POST, or CURLOPT_NOBODY can be set. In our case,
we set CURLOPT_UPLOAD correctly and then set POST and NOBODY (to zero).

This appears to reset the options to "none" which defaults to "GET"
causing the GET instead of PUT.

Using C's shortcut feture on conditionals, we check if the option should
be set before we set the option.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

slot 1: While creating new S3 bucket: The request signature we calculated does not match the signature you provided

2 participants