1
我使用WKWebview
(iOS的9)以加载https://self-signed.badssl.com/iOS9 WKWebview didReceiveAuthenticationChallenge调用主机空
尽管作为一个代表didReceiveAuthenticationChallenge
获取调用,我收到不完全protectionSpace
细节例如主机为null & authenticationMethod
是NSURLAuthenticationMethodDefault
(应该是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>
任何人都可以帮忙吗?
在此先感谢。
你应该在你的答案中给出一些更多的细节(哪个库,详细发生了什么,记录什么)......它可能对其他人有用。 –
我们正在使用AirWatch SDK,它在验证收到的质询时导致此问题。 –
我们与AirWatch SDK处于相同的情况。你能解释一下你做了什么吗? –