问题
I am using WKWebview
(iOS 9) to load https://self-signed.badssl.com/
While as a delegate didReceiveAuthenticationChallenge
is getting called, I'm receiving incomplete protectionSpace
details e.g. host is null & authenticationMethod
is NSURLAuthenticationMethodDefault
(it should be NSURLAuthenticationMethodServerTrust
)
po challenge.protectionSpace
<NSURLProtectionSpace: 0x7ff30c40fb90>: Host:(null), Server:http, Auth-Scheme:NSURLAuthenticationMethodDefault, Realm:(null), Port:0, Proxy:NO, Proxy-Type:(null)
Surprisingly if I'm writing fresh code as a new project(rather than writing in my mail project), the same code is working perfectly. So as I'm guessing this could be related to some settings.
Note: For both the code instances, ATS
is set to true.
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
Can anyone help?
Thanks in advance.
回答1:
Resolved: It was due to another Third Party Library which was causing this issue.
来源:https://stackoverflow.com/questions/38442741/ios9-wkwebview-didreceiveauthenticationchallenge-called-with-host-null