で HTTPS URL を開きたいですUIWebView
。私はすでにコードを追加していますallowsAnyHTTPSCertificateForHost
。での簡単なリクエストNSURLRequest
です。成功したようですが、iPhone には何も表示されません。
3g を使用して接続しようとすると、次のログが表示されます。
void SendDelegateMessage(NSInvocation *): delegate(webView:decidePolicyForNavigationAction:request:frame:decisionListener:) failed to return after waiting 10 seconds. main run loop mode: _kCFURLConnectionPrivateRunLoopMode
いくつかのコードを追加しようとしましたが、どれも機能しませんでした:
- (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
何が起こっているかについてのアイデアはありますか?何か不足していますか?