I have an iOS application that interacts with the server with Rails and has been stable and reliable for 3 years. The server requires basic and SSL certification, and it works fine, right up to iOS 7, including iOS 7.
However, now I see verification problems on devices running iOS 8. Devices / simulators are working <iOS 8 continues to work fine.
When you initialize the application, there is an error requesting data to synchronize with the server to which you want to pass basic authentication.
The result is the following delegate method,
willSendRequestForAuthenticationChallenge
... and the problem arises because they are disputed endlessly - the code does not work on time in the second attempt when [calling previousFailureCount]> 0 (the code path follows standard practice, calling cancelAuthenticationChallenge if the previousFailureCount> 0) - see below .
I registered call IDs and they are different for each task, even if the previousFailureCount> 0.
- (void)connection:(NSURLConnection *)connection willSendRequestForAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge { if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodHTTPBasic]) { if ([challenge previousFailureCount] == 0) { NSURLCredential *newCredential; newCredential = [NSURLCredential credentialWithUser:MY_USERNAME password:MY_PASSWORD persistence:NSURLCredentialPersistenceForSession];
If I knock out a call to test the previousFailureCount, there are endless method call calls.
However, as soon as this flurry of failures failed, subsequent and subsequent "separate" NSUrlRequests successfully authenticated.
Again, this problem is specific to iOS 8. Any ideas why the βfastβ sequence of authentication requests failed in iOS 8, but working in iOS 7?
Thanks.