I'm using Amazon .NET SDK, and adding file from my ASP.NET MVC app is working fine from my dev machine, when I`m deploying the app (on AppHarbor) I get the following error:
Could not establish trust relationship for the SSL/TLS secure channel.
Here is the code I`m using:
var config = new Amazon.S3.AmazonS3Config();
config.CommunicationProtocol = Amazon.S3.Model.Protocol.HTTPS;
using (var client = Amazon.AWSClientFactory.CreateAmazonS3Client("key", "secret", config))
{
var putRequest = new Amazon.S3.Model.PutObjectRequest();
putRequest.BucketName = "media.bunkerapp.com";
putRequest.CannedACL = Amazon.S3.Model.S3CannedACL.PublicRead;
putRequest.ContentType = file.ContentType;
putRequest.InputStream = file.InputStream;
putRequest.Key = "mykey";
Amazon.S3.Model.S3Response response = client.PutObject(putRequest);
response.Dispose();
}
I know that EU bucket cannot contains ., as seen on this question but I'm using a US Standard bucket. And again, the issue here is that it's not working on AppHarbor. I tried to roll-back to a 1 instance app, but it throw the same error, here is the stack trace:
at Amazon.S3.AmazonS3Client.ProcessRequestError(String actionName, HttpWebRequest request, WebException we, HttpWebResponse errorResponse, String requestAddr, WebHeaderCollection& respHdrs, Type t)
at Amazon.S3.AmazonS3Client.Invoke[T](S3Request userRequest)
at Amazon.S3.AmazonS3Client.PutObject(PutObjectRequest request)
at MyController...
Any pointer would be greatly appreciated.