The error message
ErrorDomain =kCFErrorDomainCFNetwork Code=310 “Problem communicating with secure Web Proxy server (HTTPS).” The UserInfo = 0 x155e20e0 {_kCFStreamErrorCodeKey = – 2096, NSErrorFailingURLStringKey = https://api.leancloud.cn/1.1/batch/save, NSErrorFailingURLKey = https://api.leancloud.cn/1.1/batch/save, NSLocalizedDescription= Problem communicating with secure Web proxy server (HTTPS). , _kCFStreamErrorDomainKey = 4, NSLocalizedRecoverySuggestion = please check your proxy Settings. Please contact your system administrator for assistance with this issue. }
Load page error occurs when ios UIWebView loads HTTPS :Error Domain=NSURLErrorDomain Code=-1202 “This server’s certificate is invalid
In the case of such problems, first set the plIST file to allow true.
The following solutions
1. Declare it in the VC of the WebView
ErrorDomain =kCFErrorDomainCFNetwork Code=310 “Problem communicating with secure Web Proxy server (HTTPS).” The UserInfo = 0 x155e20e0 {_kCFStreamErrorCodeKey = – 2096, NSErrorFailingURLStringKey = https://api.leancloud.cn/1.1/batch/save, NSErrorFailingURLKey = https://api.leancloud.cn/1.1/batch/save, NSLocalizedDescription= Problem communicating with secure Web proxy server (HTTPS). , _kCFStreamErrorDomainKey = 4, NSLocalizedRecoverySuggestion = please check your proxy Settings. Please contact your system administrator for assistance with this issue. }
Load page error occurs when ios UIWebView loads HTTPS :Error Domain=NSURLErrorDomain Code=-1202 “This server’s certificate is invalid
In the case of such problems, first set the plIST file to allow true.
The following solutions
1. Declare it in the VC of the WebView
NSURLConnection *_urlConnection;
NSURLRequest *_request;
BOOL _authenticated;
2. Add the following methods to the VC of webView
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType;
{
if (!_authenticated) {
_authenticated =NO;
_urlConnection = [[NSURLConnection alloc] initWithRequest:request delegate:self];
_request = request;
[_urlConnection start];
return NO;
}
return YES;
}
#pragma mark - NURLConnection delegate
- (void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
{
if ([challenge previousFailureCount] == 0)
{
_authenticated = YES;
NSURLCredential *credential = [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust];
[challenge.sender useCredential:credential forAuthenticationChallenge:challenge];
} else
{
[[challenge sender] cancelAuthenticationChallenge:challenge];
}
}
- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
{
// remake a webview call now that authentication has passed ok.
_authenticated = YES;
[self.webView loadRequest:_request]; // self.webView replace your webview
// Cancel the URL connection otherwise we double up (webview + url connection, same url = no good!)
[_urlConnection cancel];
}
// We use this method is to accept an untrusted site which unfortunately we need to do, as our PVM servers are self signed.
- (BOOL)connection:(NSURLConnection *)connection canAuthenticateAgainstProtectionSpace:(NSURLProtectionSpace *)protectionSpace
{
return [protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust];
}
And that should load the webView properly
Read More:
- The local web page in WebView failed to load with XMLHttpRequest
- Web Crawler: How to get the data in the web page and disguise the header, disguise as a browser to visit many times, avoid a single visit leading to IP blocked
- The web project removal server reports an error, and the web project in eclipse cannot be automatically deployed to Tomcat
- Error:kCFStreamErrorCodeKey=-2102 Domain=kCFErrorDomainCFNetwork Code=-1001 – iOS
- Chrome setting — Disable web security to solve cross domain problems
- WebView loadrequest request request error “nsurlconnection finished with error – Code – 1022”
- Breaking the web page to prevent copying
- There is more than one Web fragment with the same name: “spring_web”.
- web.xml Web app error in file
- stay web.xml Configure error page in
- QQ browser open automatically appear two web page solution
- WeChat official account web page authorized, redirect_ Uri parameter error, solution!
- Error in Maven packaging web project: webxml attribute is required (or pre existing WEB-INF)/ web.xml if executing in update)
- “503 Service Unavailable” error when connecting to vCenter Server using vSphere Web Client (2121043)
- SQL Server “login failed for user ‘domain account”. [sqlstate 28000] (error 18456). “Problem solving
- IOS development NSURLSession/NSURLConnection HTTP load failed solution
- Python’s importerror: DLL load failed: the specified module was not found and the problem was solved
- Initialization failed for ‘https://start.spring.io‘ Please check URL, network and proxy settings.
- When configuring the proxy with Vue, the front-end requests the server-side error 504; the Vue console reports the error occurred while trying to proxy request
- WebView load webpage, HTTP call error