You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "jcesarmobile (JIRA)" <ji...@apache.org> on 2016/09/08 13:30:20 UTC

[jira] [Commented] (CB-11826) Ajax calls fails in WKWebView on self-signed servers

    [ https://issues.apache.org/jira/browse/CB-11826?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15473868#comment-15473868 ] 

jcesarmobile commented on CB-11826:
-----------------------------------

Does it works on UIWebView? I don't think you can connect to servers using self-signed certificates neither.

didReceiveAuthenticationChallenge is a method from NSURLConnectionDelegate, so you won't be able to make ajax calls use it, you should create your own plugin that uses NSURLConnections instead of using AJAX

You can also put this code at the bottom of your AppDelegate.m
@implementation NSURLRequest(DataController)
+ (BOOL)allowsAnyHTTPSCertificateForHost:(NSString *)host
{
    return YES;
}
@end

But just for testing purposes, you should remove it before submitting the app to the Apple Store or Apple might reject your app.

> Ajax calls fails in WKWebView on self-signed servers 
> -----------------------------------------------------
>
>                 Key: CB-11826
>                 URL: https://issues.apache.org/jira/browse/CB-11826
>             Project: Apache Cordova
>          Issue Type: Bug
>      Security Level: Public(Anyone can view this level - this is the default.) 
>          Components: Plugin WKWebViewEngine
>    Affects Versions: 3.5.0
>         Environment: iOS 9.3.2
>            Reporter: Jörn Heid
>            Assignee: Shazron Abdullah
>
> When using jQuery's Ajax, I get
> "Failed to load resource: The certificate for this server is invalid. You might be connecting to a server that is pretending to be “xxx” which could put your confidential information at risk."
> when checking the webview in Safari through USB.
> I tried to implement the didReceiveAuthenticationChallenge method in CDVWKWebViewEngine but it doesn't seem to be called.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org