Question:
my app is working fine in ios 6.. it uploading and downloading the data from amazon web server s3..but when i upgrade my ios 6 to ios 7…i got alert message ” cannot connect to server” this error in log window
“Exception = AmazonServiceException { RequestId:5DC8AEF01DD9FB91, ErrorCode:AccessDenied, Message:AWS authentication requires a valid Date or x-amz-date header} “.
to solve this problem i upgrade my aws ios sdk 1.0.0 to aws ios sdk 1.6.1.and try to run my app it freezes for 10-12 second then app running.
so please can anyone tell me the solution how i remove ” x-amz-date header” problem in aws ios sdk 1.0.0 and its alternate freeze problem in aws ios sdk 1.6.1..
Answer:
I have submitted a bug report to Apple (to find out if this a bug or not).
In the meantime I created an awful hack that solves the issue in S3Request.m in
the method configureURLRequest:
1 2 3 4 5 |
NSString *checkFormat =[self.date requestFormat]; if(![checkFormat hasSuffix:@":00"]) checkFormat = [NSString stringWithFormat:@"%@:00",checkFormat]; [self.urlRequest setValue:checkFormat forHTTPHeaderField:kHttpHdrDate]; |
This may not be the same in your version of the AWS SDK.
I would not use this fix in the long term – I will post any response from the Apple bug report team here once they come back with a recommended solution
I also posted a question here: https://forums.aws.amazon.com/thread.jspa?threadID=135829#
EDIT: in the latest version of the toolkit the hack is:
1 2 3 4 5 |
NSString *checkFormat =[self.date stringWithRFC822Format]; if(![checkFormat hasSuffix:@":00"]) checkFormat = [NSString stringWithFormat:@"%@:00",checkFormat]; [self.urlRequest setValue:checkFormat forHTTPHeaderField:kHttpHdrDate]; |