gpt4 book ai didi

ios - 获取应用程序传输安全问题

转载 作者:塔克拉玛干 更新时间:2023-11-02 19:55:01 26 4
gpt4 key购买 nike

嘿,我收到这个错误:

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.

当尝试从网络获取图像时,我知道这必须与 iOS9 应用程序传输安全有关,但问题是在我的 plist 中我将 Allow Arbitrary Loads 设置为 true。

除此之外,我真的找不到解决这个问题的更多方法。

有没有人有什么想法?

enter image description here

最佳答案

Exception Domains 中,您可以为特定域定义安全性。在此字典中,您可以覆盖使用 NSAllowArbitoryLoads 定义的内容,例如:

NSAppTransportSecurity
NSAllowsArbitraryLoads = YES
NSExceptionDomains
"unsecure-server-i-control.example.com"
NSExceptionAllowsInsecureHTTPLoads = NO

一般情况下允许任意加载,但特别是对于 unsecure-server-i-control.example.com 它们是不允许的。

有关详细信息,请参阅 NSAppTransportSecurity in Apple docs

关于ios - 获取应用程序传输安全问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34950050/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com