iOS9 ATS:基于 HTML5 的应用程序怎么样? [英] iOS9 ATS: what about HTML5 based apps?

查看:23
本文介绍了iOS9 ATS:基于 HTML5 的应用程序怎么样?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据 https://developer.apple.com/library/content/releasenotes/General/WhatsNewIniOS/Articles/iOS9.html#//apple_ref/doc/uid/TP40016198-SW14,苹果强制在 iOS 9 中使用 HTTPS over HTTP.

According to the documentation from https://developer.apple.com/library/content/releasenotes/General/WhatsNewIniOS/Articles/iOS9.html#//apple_ref/doc/uid/TP40016198-SW14, Apple forces to use HTTPS over HTTP in iOS 9.

应用传输安全

应用传输安全 (ATS) 允许应用向其 Info.plist 文件添加声明,指定需要安全通信的域.ATS 可防止意外泄露,提供安全的默认行为,并且易于采用.无论您是要创建新应用还是更新现有应用,都应尽快采用 ATS.

App Transport Security (ATS) lets an app add a declaration to its Info.plist file that specifies the domains with which it needs secure communication. ATS prevents accidental disclosure, provides secure default behavior, and is easy to adopt. You should adopt ATS as soon as possible, regardless of whether you’re creating a new app or updating an existing one.

如果您要开发新应用,则应专门使用 HTTPS.如果您有现有应用,则应立即尽可能多地使用 HTTPS,并制定计划以尽快迁移应用的其余部分.

If you’re developing a new app, you should use HTTPS exclusively. If you have an existing app, you should use HTTPS as much as you can right now, and create a plan for migrating the rest of your app as soon as possible.

这对 Web 应用程序意味着什么,尤其是.基于 Sencha Touch 和 Cordova/PhoneGap 的?我的网络应用程序可以配置为任何服务器地址,因此我无法在 plist 文件中将它们列入白名单.这是否仅适用于使用本机请求(通过 NSURLRequest 等)的应用程序?

What does that mean for web applications, esp. Sencha Touch and Cordova/PhoneGap based ones? My web app can be configured to any server address, so there's no way I can whitelist them in a plist file. Will this only be applicable for applications that use native requests (via NSURLRequest etc.)?

推荐答案

如果您不确定您的应用程序将连接哪个 URL,或者您连接到多个 URL,您可以通过添加以下内容绕过 ATS(应用程序传输安全)info.plist 文件中的键.

If you are not sure of which URL your application will connect or if you connect to many URLs, you can bypass the ATS (App Transport Security) by adding following keys in info.plist file.

<key>NSAppTransportSecurity</key> 
<dict>
    <key>NSAllowsArbitraryLoads</key> <true/> 
</dict>

这篇关于iOS9 ATS:基于 HTML5 的应用程序怎么样?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆