App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure.

网络请求时Xcode提示:

App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure.

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

解决办法:

在info.plist中添加
<key>NSAppTransportSecurity</key><dict>
<key>NSAllowsArbitraryLoads</key>
<true/></dict>

未经允许不得转载:天宝寺||陈瑞轩 » App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure.

赞 (0) 打赏

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏