Note that there are some explanatory texts on larger screens.

plurals
  1. POAmazon S3 issues getting SSL to work with c# sdk
    primarykey
    data
    text
    <p>I'm using the Amazon AWS .NET SDK v1.2.1.</p> <p>The following code throws an exception after failing a DNS lookup for <code>myBucket.more.https</code> which is clearly not what it should be looking for...</p> <pre><code>AmazonS3Config S3Config = new AmazonS3Config() { ServiceURL = "https://s3.amazonaws.com", CommunicationProtocol = Amazon.S3.Model.Protocol.HTTPS, }; using (AmazonS3 client = Amazon.AWSClientFactory.CreateAmazonS3Client(accessKey,secretKey, S3Config)) { PutObjectRequest request = new PutObjectRequest(); using (MemoryStream ms = new MemoryStream(inputBytes)) { request.WithBucketName("myBucket.more") .WithKey(output.Name) .WithInputStream(ms); using (S3Response response = client.PutObject(request)) { Log.Message("File Sent: " + output.Name); } } } </code></pre> <p>If I remove the <code>https://</code> from the front of the ServiceURL it throws a web exception with:</p> <p><code>"The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel."</code></p> <p>So how am I suppose to get SSL working?</p> <p>The only way I've managed so far is with the following, which is not secure:</p> <pre><code>AmazonS3Config S3Config = new AmazonS3Config() { ServiceURL = "s3.amazonaws.com", CommunicationProtocol = Amazon.S3.Model.Protocol.HTTP, }; </code></pre> <p><strong>UPDATE</strong></p> <p>If I don't pass a custom S3Config to <code>CreateAmazonS3Client</code>, it is still failing with:</p> <p><code>"The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel."</code></p> <p><code>"The remote certificate is invalid according to the validation procedure."</code></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload