Sarabjeet Singh Gaba
Sarabjeet Singh Gaba

Reputation: 95

iOS9 WKWebview didReceiveAuthenticationChallenge called with host null

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.

Upvotes: 1

Views: 672

Answers (1)

Sarabjeet Singh Gaba
Sarabjeet Singh Gaba

Reputation: 95

Resolved: It was due to another Third Party Library which was causing this issue.

Upvotes: 1

Related Questions