Skip to content
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

Local Minio server returns SignatureDoesNotMatch with iOS AWS S3 SDK v2.4.16 #4101

Closed
laurentgdh opened this issue Apr 11, 2017 · 2 comments
Closed

Comments

@laurentgdh
Copy link

Use case: upload & download data to / from Minio from an iOS app. I'm currently developing the project so I'm using Minio locally (using docker).

I'm using the AWS SDK v2.4.16 so I can change the endpoint and I made it my localhost (http://my-imac.local:9000) and I updated my access and secret keys but I get a SignatureDoesNotMatch error: "The request signature we calculated does not match the signature you provided. Check your key and signing method.".

Pointing to my local server:

AWSEndpoint *minioEndpoint = [[AWSEndpoint alloc] initWithURLString:@"http://my-imac.local:9000"];
AWSServiceConfiguration *configuration = [[AWSServiceConfiguration alloc] initWithRegion:region 
        endpoint:minioEndpoint 
        credentialsProvider:credentialProvider];
[AWSS3 registerS3WithConfiguration:configuration forKey:s3RegionString];

Log on my localhost:

time="2017-04-10T23:36:21Z" level=error msg="{\"method\":\"PUT\",\"path\":\"/mybucket/28AB7D6DCFC44102955EBC0AEFF6E4E2-20170407161228839-0700/foo_28AB7D6DCFC44102955EBC0AEFF6E4E2-20170407161228839-0700_v2.json_bin\",\"query\":\"\",\"header\":{\"Accept\":[\"/\"],\"Accept-Encoding\":[\"gzip, deflate\"],\"Accept-Language\":[\"en-us\"],\"Authorization\":[\"AWS4-HMAC-SHA256 Credential=LNTXV0YMMZ9SY7MD0ACZ/20170410/us-east-1/s3/aws4_request, SignedHeaders=content-length;content-type;host;user-agent;x-amz-date, Signature=7b2f4172dd926ba84c7edba5170028e0f9361bd8a656ad8f01c7e232f585ab31\"],\"Connection\":[\"keep-alive\"],\"Content-Length\":[\"282416\"],\"Content-Type\":[\"application/octet-stream\"],\"Host\":[\"my-imac.local\"],\"User-Agent\":[\"aws-sdk-iOS/2.4.16 iPhone-OS/9.1 en_US\"],\"X-Amz-Date\":[\"20170410T233620Z\"]}}" cause="Signature does not match" source="[object-handlers.go:472:objectAPIHandlers.PutObjectHandler()]"

Logs on the iOS side:

The request headers are:

{
    Authorization = "AWS4-HMAC-SHA256 Credential=LNTXV0YMMZ9SY7MD0ACZ/20170410/us-east-1/s3/aws4_request, SignedHeaders=content-length;content-type;host;user-agent;x-amz-date, Signature=454c8bad35bdd3a15a08c9bf555fc69f1d5c0dabad78a474eabd4d844ca69aef";
    "Content-Length" = 282416;
    "Content-Type" = "application/octet-stream";
    Host = "my-imac.local";
    "User-Agent" = "aws-sdk-iOS/2.4.16 iPhone-OS/9.1 en_US";
    "X-Amz-Date" = 20170410T233622Z;
}

The response:

2017-04-10 16:36:22.507 demo[7969:4711709] AWSiOSSDK v2.4.16 [Debug] AWSURLSessionManager.m line:566 | -[AWSURLSessionManager printHTTPHeadersForResponse:] | Response headers:
{
    "Accept-Ranges" = bytes;
    Connection = close;
    "Content-Type" = "application/xml";
    Date = "Mon, 10 Apr 2017 23:36:22 GMT";
    Server = "Minio/RELEASE.2017-03-16T21-50-32Z (linux; amd64)";
    "Transfer-Encoding" = Identity;
    Vary = Origin;
    "X-Amz-Request-Id" = 14B42D7AE5B09A2B;
}

VERSION
2017-03-16T21:50:32Z
MEMORY
Used: 2.9 MB | Allocated: 12 MB | Used-Heap: 2.9 MB | Allocated-Heap: 8.9 MB
PLATFORM
Host: 883ec8869eed | OS: linux | Arch: amd64
RUNTIME
Version: go1.7.3 | CPUs: 4

AWS' S3 SDK version 2.4.16

@harshavardhana
Copy link
Member

@laurentgdh AWS IOS SDK doesn't support endpoints with port in it for example "Host\":[\"my-imac.local\" - for example here aws-amplify/aws-sdk-ios#349

There is a way out btw please follow the issue here #4039 you can make it work if you configured Minio on port 80 or 443.

Closing this issue as duplicate.

@lock
Copy link

lock bot commented May 6, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators May 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants