IOS 10 Adaptive HTTPS contains some compatible configurations for some HTTP

Source: Internet
Author: User

IOS10 since January 1, 2017 Apple has proposed that all newly submitted apps will not be allowed NSAllowsArbitraryLoads to bypass ATS restrictions by default, that is, forcing us HTTPS to use, and if not, submitting the app may be rejected.

Usually there are two kinds of situations in your company:

1. Our company does not have the money, to find a way to make a certificate, ha ha. is not very hard, and then you configure yourself: refer to other Blogs

2. Your company is rich, oh, big companies, like ours company;

First we went to Vodafone to buy a certificate. I looked at the half-day, but also to import what certificate things (estimate is also copied by Baidu), the actual front-end nothing to deal with. At most, you're in the Afnet. Security requires certificate validation.

_sharedclient = [Mssageafnetrequest manager];

Afsecuritypolicy *securitypolicy = [Afsecuritypolicy policywithpinningmode:afsslpinningmodecertificate];

Securitypolicy.allowinvalidcertificates = NO;

Securitypolicy.validatesdomainname = YES;

_sharedclient.securitypolicy = securitypolicy;

At this time you need to remove the plist inside the security settings info.plist file to add a AppTransportSecuritySettings dictionary, which will be NSAllowsArbitraryLoads set to YES disable ATS. This option, everyone has been in this way before.

Then---------------------------the split line below--------------------------

Need to configure plist to be compatible with some third-party or not HTTPS request domain names, the requested network picture is http:

Operation:

1) Add a Key:app Transport Security Settings in Project Info.plist, type

Dictionary;

2) Add a key:exception Domains, the type is dictionary;

3) Add the domain to be supported within exception domains, where the domain is the key and the type is dictionary;

4) You need to set 3 properties under each domain: Boolean type;

Nsincludessubdomains YES

Nsexceptionrequiresforwardsecrecy NO

Nsexceptionallowsinsecurehttploads YES

Note: You need to set these three properties for each domain you want to add. If the requested network picture is HTTP, it is also the domain of the picture that needs to be set.

IOS 10 Adaptive HTTPS contains some compatible configurations for some HTTP

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.