1

I am using NSURLConnection for one field service type iOS appliation, so app is field service type there are more then 50 users and more then 50 users may use the application on same time that's why there are more then 50 or 60 request come to the server. Now my issue is I have received below two errors frequently means every single user can face this error more then 5 times in one day. so it become a challenge for me.

The Error Code:

-1202 NSURLErrorServerCertificateUntrusted

-1012 NSURLErrorUserCancelledAuthentication

I have searched a lot and i found that they are server related errors but still i don't have any solution for how to resolve this problem.

Please help me how can i solve this NSURLConnection error (-1202 NSURLErrorServerCertificateUntrusted and -1012 NSURLErrorUserCancelledAuthentication) problem.

Thanks in advance.

Nikh1414
  • 1,212
  • 1
  • 18
  • 35

1 Answers1

1

You need to use connectionWithRequest:delegate: to accept untrusted certificates.

You can implement these delegate methods

- (BOOL)connection:(NSURLConnection *)connection canAuthenticateAgainstProtectionSpace:(NSURLProtectionSpace *)protectionSpace
{
    return YES;
}

- (BOOL)connectionShouldUseCredentialStorage:(NSURLConnection *)connection
{
    return YES;
}
rfrittelli
  • 1,193
  • 11
  • 15
  • OK thanks, can you explain me how to accept that untrusted certificate and I should use which delegate method of NSURLConnection? – Nikh1414 Oct 21 '13 at 13:00