2013-03-07 61 views
0

我碰到下面的错误,而试图上传使用AFNetworking/AFAmazonS3ClientAFNetworking/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]]; 
        }]; 

此服务器的证书是无效的文件到亚马逊。您可能正在连接到一个伪装成“media.myserver.com.s3.amazonaws.com”,这可能会危害您的机密信息

如何解决这个

感谢 Tonku

服务器

回答

0

万一别人绊倒到这一点:没有在这期间使用水桶的名称(例如media-mysite-com) 。这样,亚马逊的通配符SSL证书仍然适用,并且您将避免该错误。

参见例如How to Configure SSL for Amazon S3 bucket