|
1.在iOS 9的时候,默认非HTTS的网络是被禁止的,我们可以在info.plist文件中添加NSAppTransportSecurity字典,将NSAllowsArbitraryLoads设置为YES来禁用ATS;
2.从2017年1月1日起,,所有新提交的 app 默认不允许使用NSAllowsArbitraryLoads来绕过ATS的限制,默认情况下你的 app 可以访问加密足够强的(TLS V1.2以上)HTTPS内容;
3.可以选择使用NSExceptionDomains设置白名单的方式对特定的域名开放HTTP内容来通过审核:
- <key>NSAppTransportSecurity</key>
- <key>NSAllowsArbitraryLoads</key>
- <false/>
- <key>NSExceptionDomains</key>
- <dict>
- <key><!-- your_remote_server.com / localhost --></key>
- <dict>
- <key>NSIncludesSubdomains</key>
- <true/>
- <key>NSExceptionAllowsInsecureHTTPLoads</key>
- <true/>
- <key>NSExceptionRequiresForwardSecrecy</key>
- <true/>
- </dict>
- <!-- add more domain here -->
- </dict>
复制代码
|
|