user2722667
user2722667

Reputation: 8661

Swift 2 ios 9 complaining about http even though I am using https to connect to amazon s3

I am trying to load images from amazon s3 (async).

But I get these errors in my log:

NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL,-9802)

I am making all my api calls with "https", it worked in ios 8.3 / xcode6

So

Upvotes: 1

Views: 1293

Answers (3)

Jeef
Jeef

Reputation: 27275

You are running into the HTTPS errors of App Transport Security read here: Transport security has blocked a cleartext HTTP

But the basic jist is add the following to your info.plist

<key>NSAppTransportSecurity</key>
<dict>
  <key>NSAllowsArbitraryLoads</key>
      <true/>
</dict>

You can do that via a text editor or in XCODE as such:

enter image description here

Upvotes: 0

Jeef
Jeef

Reputation: 27275

You are running into the HTTPS errors of App Transport Security read here: Transport security has blocked a cleartext HTTP

But the basic jist is add the following to your info.plist

<key>NSAppTransportSecurity</key>
<dict>
  <key>NSAllowsArbitraryLoads</key>
      <true/>
</dict>

Upvotes: 2

Matodobra24
Matodobra24

Reputation: 55

Add the following to your info.plist exactly as typed.

NSAppTransportSecurity

Once you create that make its value a dictionary called

NSAllowsArbitraryLoads

Set the value to true or yes

Upvotes: 2

Related Questions