gpt4 book ai didi

objective-c - iOS9 WKWebview didReceiveAuthenticationChallenge 调用主机为空

转载 作者:太空宇宙 更新时间:2023-11-03 13:24:09 24 4
gpt4 key购买 nike

我正在使用 WKWebview (iOS 9) 加载 https://self-signed.badssl.com/

当委托(delegate) didReceiveAuthenticationChallenge 被调用时,我收到了不完整的 protectionSpace 详细信息,例如host 为 null & authenticationMethodNSURLAuthenticationMethodDefault(应该为 NSURLAuthenticationMethodServerTrust)

po challenge.protectionSpace
<NSURLProtectionSpace: 0x7ff30c40fb90>: Host:(null), Server:http, Auth-Scheme:NSURLAuthenticationMethodDefault, Realm:(null), Port:0, Proxy:NO, Proxy-Type:(null)

令人惊讶的是,如果我将新代码编写为一个新项目(而不是在我的邮件项目中编写),相同的代码可以完美运行。所以我猜这可能与某些设置有关。

注意:对于这两个代码实例,ATS 都设置为 true。

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

有人能帮忙吗?

提前致谢。

最佳答案

已解决:这是由于另一个第三方库导致了这个问题。

关于objective-c - iOS9 WKWebview didReceiveAuthenticationChallenge 调用主机为空,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38442741/

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