IOS处理:
在appDelegate.m文件中添加以下代码:
@implementation NSURLRequest(DataController)
+ (BOOL)allowsAnyHTTPSCertificateForHost:(NSString *)host
{
return YES;
}
@end
Android处理:
1、如果没有使用crosswalk
修改 org.apache.cordova.engine.SystemWebViewClient.java文件中onReceivedSslError()方法为如下:
/**
* Notify the host application that an SSL error occurred while loading a resource.
* The host application must call either handler.cancel() or handler.proceed().
* Note that the decision may be retained for use in response to future SSL errors.
* The default behavior is to cancel the load.
*
* @param view The WebView that is initiating the callback.
* @param handler An SslErrorHandler object that will handle the user's response.
* @param error The SSL er