简体   繁体   English

iOS 9:应用程式传输安全性

[英]iOS 9: App Transport Security

I am trying to display the www.usta.com website in my application. 我正在尝试在我的应用程序中显示www.usta.com网站。

I added the following keys to my .plist and the site loads some of the data. 我在.plist中添加了以下键,该站点加载了一些数据。 However, it will not load any of the images. 但是,它不会加载任何图像。

Does anyone know why the images won't load? 有人知道为什么无法加载图像吗?

在此处输入图片说明

I am testing on an iPhone 6 device that has iOS 9.3 installed. 我正在安装了iOS 9.3的iPhone 6设备上进行测试。

The website you're asking about uses Amazon S3 to serve images. 您要查询的网站使用Amazon S3来提供图像。 This screenshot shows where the images are loading from: 此屏幕快照显示了从何处加载图像:

Safari的Inspector打开的USTA.com的屏幕截图

Since App Transport Security checks for a matching domain name, you need to add the s3 domain ( amazonaws.com ) to your plist. 由于App Transport Security会检查匹配的域名,因此您需要将s3域( amazonaws.com )添加到您的plist中。

My first try would be to simply allow arbitrary loads, unless you are wanting ONLY usta.com to be able to load. 我的第一个尝试是简单地允许任意加载,除非您只希望usta.com能够加载。 This should be the most simple way of doing it unless you are wanting to restrict which kinds of websites (http vs https) will load other than usta. 这应该是最简单的方法,除非您想限制除usta之外还将加载哪种类型的网站(http或https)。

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM