![](/img/trans.png)
[英]How to Bypass SSL check in iOS 11 using Ionic Cordova framework and self signed certificate
[英]On ios, in ionic hybrid app, how to bypass certificate check (using self-signed certificates)
我的離子/ cordova應用程序現在在與HTTPS后端一起使用時會出錯
`The certificate for this server is invalid`
我在我的開發環境中,使用自簽名證書,並使用IP地址連接后端。
我使用openssl s_client
檢查了證書,看起來有效。 事實上,我可以使用與這個混合應用程序的Android版本相同的后端。
是否有一些plist
或其他Xcode
設置接受自簽名證書或一起忽略此測試 - 類似於NSAppTransportSecurity::NSAllowsArbitraryLoads
設置?
- 編輯
我在config.xml
文件中有<access origin="*"/>
。
非常感謝
您可以在AppDelegate.m的末尾添加它,但僅出於測試目的,您應該在發布應用程序之前將其刪除,如果應用程序包含該代碼,Apple可能不會批准該應用程序
@implementation NSURLRequest(DataController)
+ (BOOL)allowsAnyHTTPSCertificateForHost:(NSString *)host
{
return YES;
}
@end
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.