2013-03-07 85 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