I could not able to do https POST call using ajax from ipad/iphone. Actually I am trying to call this in my PhoneGap application.
Could you please help me in this regard.
Did you try to add this at the end of you AppDelegate.m file
@implementation NSURLRequest(DataController)
+ (BOOL)allowsAnyHTTPSCertificateForHost:(NSString *)host
{
return YES;
}
@end
You have not stated the kind of certificate on the server. I suspect that it is self signed. I have also had the same problem. Doing Ajax calls to a server with self signed certificated is NOT possible and this is a SDK limitation. You must write an Objective C plugin to go around this.
TDeBailleul,
Your code seems to work for an anonymous area of the web server, but doesn't work for myself in an Authorized area (cgi.auth_user) with Basic/NTLM authorization.
PhoneGap for iOS FAQ Q. Can I do AJAX with servers that have self-signed certificates? A. No, this is a iOS SDK limitation with UIWebview. You'll have to write an Objective-C plugin.
http://wiki.phonegap.com/w/page/41631150/PhoneGap%20for%20iOS%20FAQ
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With