Xcode 7中http通信出现如下错误:Application Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file.

原因

在iOS9 beta1中,苹果将原http协议改成了https协议,使用 TLS1.2 SSL加密请求数据。

解决方法

编辑 info.plist,加入如下设置:

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

在info.plist中查看如下所示:


屏幕快照 2015-11-16 下午7.03.38.png
 
 
文/若水V_V(简书作者)
原文链接:http://www.jianshu.com/p/c663a1f274fa
著作权归作者所有,转载请联系作者获得授权,并标注“简书作者”。

posted on 2016-11-25 10:45  偏左  阅读(126)  评论(0)    收藏  举报

导航