为什么有些 https 链接没有加载 WebView。我可以看到一些 https url 在 safari 浏览器中完美加载,但是当我尝试在 webview 中加载相同的 url 时,它没有加载。可能是因为https有自签名证书??我们不能在具有自签名证书的 WebView 中加载 url 吗?
编辑:现在我可以打电话了
- (BOOL)connection:(NSURLConnection *)connection canAuthenticateAgainstProtectionSpace:(NSURLProtectionSpace *)protectionSpace
{
return YES;
}
- (void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
{
[challenge.sender useCredential:[NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust] forAuthenticationChallenge:challenge];
}
我的 https url 仍然没有加载到 WebView 中。