I am very very new to Mobile Apps development and HTTPs. Please bear with me... I need your advice!
My iPhone app communicates with a server over HTTPS with uses Self Signed Certificate.
To fix situation with a warning message that my server is untrusted I used NSURLConnection delegate methods and this approach:
- (void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge {
if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust])
{
[challenge.sender useCredential:[NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust] forAuthenticationChallenge:challenge];
}
[challenge.sender continueWithoutCredentialForAuthenticationChallenge:challenge];
}
My first question is this: Will Apple approve this approach? Is it an allowed and legal way of dealing with HTTPs Requests when communicating with a server that uses Self Signed Certificate?
When using the above mentioned approach to give my consent and still connect to an untrusted server, is my data going to be send over HTTPs and will it be encrypted?