IOS9 Network adaptation

Source: Internet
Author: User

  Today's upgrade Xcode7.0, found that network access failed.
Output error message:The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.

After Google verified, IOS9 introduced new features App Transport Security (ATS) . The new feature requires that the network access within the app must use HTTPS protocols: Network requests sent by the IOS9 system will be unified using TLS 1.2 SSL. With the TLS 1.2 protocol, the purpose is to enforce enhanced data access security, and related network requests under the System Foundation framework will no longer default to unsecured network protocols such as Http , and TLS 1.2 is used by default.

The server therefore needs to be updated to parse the relevant data. But now the company's projects use a HTTP protocol, using private encryption to ensure data security, and now can not immediately change to HTTPS protocol transmission. If not updated, you can reverse the unsecured network request by declaring it in Info.plist.

There are two types of solutions available:

Scenario One: Immediately let the company's server upgrade use TLS 1.2

Scenario Two: Although Apple does not recommend, but can be declared in the Info.plist, back to the insecure network request will still allow the app to access the specified HTTP, or even arbitrary HTTP,

1. Add the type in NSAppTransportSecurity info.plist Dictionary .

2. NSAppTransportSecurity under Add NSAllowsArbitraryLoads type Boolean , set value toYES

      3.Clean up the cache

IOS9 Network adaptation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.