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