question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

iOS NSAppTransportSecurity

See original GitHub issue

Hey there,

Im getting a networking error when trying to upload to S3 from my react-native app running on my device.

Error

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

From Googling around there are suggestions to add the AWS domains to the NSExceptionDomains in the info.plist. Ive tried the following xml in the plist but am still experiencing the same issue.

<key>NSAppTransportSecurity</key>
<dict>
  <key>NSAllowsArbitraryLoads</key>
  <true/>
  <key>NSExceptionDomains</key>
  <dict>
    <key>amazonaws.com</key>
    <dict>
      <key>NSThirdPartyExceptionMinimumTLSVersion</key>
      <string>TLSv1.0</string>
      <key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
      <false/>
      <key>NSTemporaryExceptionRequiresForwardSecrecy</key>
      <false/>
      <key>NSTemporaryExceptionMinimumTLSVersion</key>
      <string>1.0</string>
      <key>NSIncludesSubdomains</key>
      <true/>
      <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
      <true/>
    </dict>
    <key>amazonaws.com.cn</key>
    <dict>
      <key>NSThirdPartyExceptionMinimumTLSVersion</key>
      <string>TLSv1.0</string>
      <key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
      <false/>
      <key>NSTemporaryExceptionRequiresForwardSecrecy</key>
      <false/>
      <key>NSTemporaryExceptionMinimumTLSVersion</key>
      <string>1.0</string>
      <key>NSIncludesSubdomains</key>
      <true/>
    </dict>
  </dict>
</dict>

What NSAppTransportSecurity do you use for uploading to S3?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
phoenixboxcommented, Jul 13, 2016

@benjreinhart so I fixed the issued I was experiencing.

This error:

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

Was due to an untrusted local react-native server development certificate:

The certificate for this server is invalid. You might be connecting to a server that is pretending to be “${YOUR_BUCKET_NAME}.s3.amazonaws.com” which could put your confidential information at risk.

To which there is an advised:

Solution Repo

1reaction
benjreinhartcommented, Jul 14, 2016

@phoenixbox very nice, thank you for the detailed follow up!

Read more comments on GitHub >

github_iconTop Results From Across the Web

NSAppTransportSecurity | Apple Developer Documentation
NSAppTransportSecurity. A description of changes made to the default security for HTTP connections. iOS 9.0+ iPadOS 9.0+ macOS 10.11+ ...
Read more >
How can I add NSAppTransportSecurity to my info.plist file?
App Transport Security, or ATS, is a feature that Apple introduced in iOS 9. When ATS is enabled, it forces an app to...
Read more >
App Transport Security | CodePath iOS Cliffnotes
In iOS 9, Apple introduced "App Transport Security," or ATS. ... You can poke holes in ATS by adding a NSAppTransportSecurity dictionary to...
Read more >
Guide to iOS App Transport Security (ATS) - NowSecure
A security analyst's guide to NSAppTransportSecurity, NSAllowsArbitraryLoads, and App Transport Security (ATS) exceptions.
Read more >
App Transport Security | iOS - Google Developers
plist file to disable ATS restrictions. <key>NSAppTransportSecurity</key>
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found