Skip to content

GetObject with range cause SignatureDoesNotMatch #366

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

Closed
hailbird opened this issue Dec 6, 2016 · 4 comments
Closed

GetObject with range cause SignatureDoesNotMatch #366

hailbird opened this issue Dec 6, 2016 · 4 comments

Comments

@hailbird
Copy link

hailbird commented Dec 6, 2016

With the following code, getObjectOutcome reports SignatureDoesNotMatch. If the WithRange is comment out, everything is fine.

        Aws::StringStream range;
        range << "bytes=" << off << "-" << off + len - 1;
        GetObjectRequest getObjectRequest;
        getObjectRequest
                .WithRange(range.str())    // range is "0-5242879". Good if comment out this line.
                .WithBucket(bucketName)
                .WithKey(oid);             // the size of the object is 12M
        GetObjectOutcome getObjectOutcome = client->GetObject(getObjectRequest);

The corresponding logs are attached.
aws_sdk_2016-12-06-15-without-range.log.txt
aws_sdk_2016-12-06-15-with-range.log.txt

@hailbird hailbird changed the title Get with range cause SignatureDoesNotMatch GetObject with range cause SignatureDoesNotMatch Dec 6, 2016
@hailbird
Copy link
Author

hailbird commented Dec 7, 2016

The problem is due to setting Schem as HTTP by mistake. The interesting point is it worked well without "range:bytes=....".

@hailbird hailbird closed this as completed Dec 7, 2016
@chvink
Copy link

chvink commented May 23, 2017

Does anyone know why this can't work with HTTP and how to work around it? I'm trying to do a threaded multi-part download through an HTTP proxy using GetObjectRequest::SetRange() but I can't download the first ~36 megabytes from the S3 key because of the signature error.

@hailbird
Copy link
Author

As I tried, you can only use HTTPS.

@chvink
Copy link

chvink commented May 24, 2017

I've confirmed that HTTPS does make the error go away, but the odd thing with that is that I don't see the failed signature check with HTTP if I'm in a setup where I don't need my proxy. I have yet to test this with the latest build so I don't know if how the new proxyScheme field will affect this, but this still seems like a bug so I'm tempted to open up a fresh issue for it.

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

No branches or pull requests

2 participants