[Solved]Authentification error 0 http xhr request


#1

Hello everybody,

I try to authentificate with a third party service with the standard $http service but it does not work on IOS. (The authentification works on Android devices and browsers so far).

What I tried so far:

The first problem i ran into was the that the third party service uses a self signed certificat so I added this code to AppDelegate.m

@implementation NSURLRequest(DataController)
+ (BOOL)allowsAnyHTTPSCertificateForHost:(NSString *)host
{
return YES;
}
@end

But now every time I try to authenticate with the server I get a 0 Error (response) either with the message failed to load resource: The network connection was lost… or just failed to load resources

So the I tried to add several different things like:

->Editing config.xml

> <access origin="*" subdomains="true" />
> <allow-navigation href="*" />
> <allow-intent href="*" />

->Add meta tags to index.html

as described here https://github.com/apache/cordova-plugin-whitelist

but I still have the same error… has anyone an idea?

looking forward to hearing from you. :wink:

Many thanks,
Jacob


#2

You’re using which iOS version?


#3

Hey Gajotres,

I use iOS version 8.4

> Cordova CLI: 5.1.1
> Gulp version:  CLI version 3.8.11
> Gulp local:   Local version 3.8.11
> Ionic Version: 1.0.0-rc.3
> Ionic CLI Version: 1.6.4
> Ionic App Lib Version: 0.3.8
> ios-deploy version: Not installed
> ios-sim version: 4.1.1
> OS: Mac OS X Yosemite
> Node Version: v0.12.2
> Xcode version: Xcode 6.4 Build version 6E35b

Best regards,
Jacob


#4

It also does not work with older iOS versions e.g. 8.3


#5

Problem solved:

The Service runs on nginx and the request got somehow aborted but only requests from IOS devices…

Error noitifcation nginx server:

worker process 8730 exited on signal 11

editing the nginx configuration /etc/nginx/nginx.conf and inserting

ssl_session_cache    shared:SSL:10m;

solved the problem.

Best regards,
Jacob