I am using the Amazon.NET SDK and adding a file from my ASP.NET MVC application works fine from my dev machine when I deploy the application (on AppHarbor ) I get the following error:
Failed to establish trust for 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 the EU bucket cannot contain., As can be seen on this , but I use the US Standard bucket. And again, the problem here is that it is not working on AppHarbor. I tried to return to 1 instance of the application, but it gives 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 is appreciated.
source share