I get the following error, while trying to upload a file to Amazon using AFNetworking / AFAmazonS3Client
s3Client = [[AFAmazonS3Client alloc] initWithAccessKeyID:@"mykey" secret:@"mysecretkey"];
s3Client.bucket = @"media.mysite.com";
[s3Client postObjectWithFile:video.assetPath destinationPath:@"/media/videos/" parameters:nil progress:
^(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite){
DLog(@"%f%% Uploaded", (totalBytesWritten / (totalBytesExpectedToWrite * 1.0f) * 100));
}
success:^(id responseobject){
DLog(@"Success");
[self deleteAsset:video];
}failure:^(NSError* error){
DLog(@"Failed %@", error);
[self updateVideoAsset:video.assetID key:@"uploadStatus" value:[NSNumber numberWithInt:ESUploadNotStarted]];
}];
The certificate for this server is invalid. You might be connecting to a server that is pretending to be “media.myserver.com.s3.amazonaws.com” which could put your confidential information at risk
how to get around this
Thanks Tonku