0

I want to open a HTTPS URL with my UIWebView. I already add the code which allowsAnyHTTPSCertificateForHost. It's a simple request with my NSURLRequest, it seems it was successful but nothings is shown in my iPhone.

And when I try to connect using my 3g this log appears:

void SendDelegateMessage(NSInvocation *): delegate(webView:decidePolicyForNavigationAction:request:frame:decisionListener:) failed to return after waiting 10 seconds. main run loop mode: _kCFURLConnectionPrivateRunLoopMode

I tried to add couple codes but none of them worked:

- (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];
}

@implementation NSURLRequest (NSURLRequestWithIgnoreSSL)

+ (BOOL)allowsAnyHTTPSCertificateForHost:(NSString *)host
{
    return YES;
}

@end

Any ideas of what is happening? Am I missing something?

rein
  • 32,967
  • 23
  • 82
  • 106

0 Answers0