IOS9 and XCode7 quick fixes that do not use HTTP connections _ios

Source: Internet
Author: User

When compiling the iOS app in Xcode7.0 and above, a new feature of iOS9 is used by default, making all HTTP connections disabled, and the APIs used in the project without HTTPS support are tragic. On the official document, there is such a phrase

 "> App transport security app Transport Security (ATS) enforces best practices in the Secur e connections between an app. ATS prevents accidental disclosure, provides secure default behavior, and are easy to adopt; It is also with default in IOS 9 and OS X v10.11.
You are should adopt ATS as soon as possible, regardless of whether you ' re creating a new app or updating a existing one. If you are developing a new app, you should use HTTPS exclusively. If you are have an existing app, your should use HTTPS as so much as you can right now, and create a's for migrating the rest O F your app as soon as possible. In addition, your communication through higher-level APIs needs to is encrypted using TLS version 1.2 with forward secrecy . If you try to make a connection which doesn ' t follow this requirement, the error is thrown. If your app needs to make a request to a insecure domain, your have to specify this domain in your app ' s info.plist file.< /pre> 

You can see here that by modifying the Info.plist file you can continue to use the HTTP connection in the following ways:

1. Find the Info.plist file on the left side of the project, you can search by filter


2. On the right click Add Row Add nsapptransportsecurity, type dictionary, and then add subprojects Nsallowsarbitraryloads class behavior Boolean value Yes


This allows you to reuse the normal HTTP connection. But if you have a condition, you should go and get an HTTPS.

The above is a small set to introduce the iOS9 and XCode7 can not use the HTTP connection of the fast solution, I hope to help you, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!

Related Article

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.