The (soon to be deprecated) NSURLConnectionDelegate allows you to handle a TLS trust challenge like so:
-(void)connection:(NSURLConnection *)connection willSendRequestForAuthenticationChallenge(NSURLAuthenticationChallenge *)challenge
{
if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust])
[challenge.sender performDefaultHandlingForAuthenticationChallenge:challenge];
}
Assuming that the same x509 certificate is being presented by the same server, my testing shows that the effect of this method is cached for the duration of the application execution. This method is not hit again.
Is there a way to force the application to forget the effect of this method after the handling has occurred, such that subsequent hits to the same web service force this method to be called?