WKWebView don't work for https+websocket with self-signed certificate

Following works fine for https url with self signed certificate. But it does not work for secured websocket protocol with self signed ceritificate

  • (void)webView:(WKWebView *)webView didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition, NSURLCredential * _Nullable))completionHandler

{ NSURLCredential * credential = [[NSURLCredential alloc] initWithTrust:[challenge protectionSpace].serverTrust]; completionHandler(NSURLSessionAuthChallengeUseCredential, credential); } }

WKWebView don't work for https+websocket with self-signed certificate
 
 
Q