When I connect to an SSO X509 connection that requires client certificate, I provide the credential and it succeeds. Next time the didReceiveChallenge delegate method is hit, auth method is NSURLAuthenticationMethodServerTrust and I have the following code for this authMethod
completionHandler(NSURLSessionAuthChallengeUseCredential,[NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust]);
For the next request, I again get authMethod as NSURLAuthenticationMethodClientCertificate.
So basically for every request, the delegate method is hit twice, once with authMethod as NSURLAuthenticationMethodClientCertificate and second time with authMethod NSURLAuthenticationMethodServerTrust
I do not want to repeatedly get authMethod as NSURLAuthenticationMethodClientCertificate for every request.
What is the reason for this and how to avoid it? It affects performance to authenticate each time