美文网首页
Xcode的HTTPS错误

Xcode的HTTPS错误

作者: darling323 | 来源:发表于2016-06-25 18:08 被阅读172次

错误信息:

App 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.

主要是在有第三方SDK在import后,这些SDK基本都是http连接,不符合苹果的HTTPS要求。

解决方法:

1是关闭https验证,2是添加例外。
都是右键打开info.plist,选择open as source code

1.关闭验证,添加代码:

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


1.png

2.添加例外,稍微麻烦,而且要知道你的网络连接的域名:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>bmob.com</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
</dict>
<key>wtc.edu.cn</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
</dict>
</dict>
</dict>

相关文章

网友评论

      本文标题:Xcode的HTTPS错误

      本文链接:https://www.haomeiwen.com/subject/lijadttx.html