2017-09-22 4 views
0

J'utilise l'authentification mutuelle dans iOS 10 qu'avec l'instruction if l'authentification mutuelle ci-dessous fonctionne correctement.il y a un problème avec NSURLAuthenticationMethodClientCertificate que pas de retour

-(void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge 
{ 
    if ([protectionSpace authenticationMethod] == NSURLAuthenticationMethodServerTrust) { 

// do something 

} else if ([protectionSpace authenticationMethod] == NSURLAuthenticationMethodClientCertificate) { 

// Do something 

} 
} 

Dans iOS 10 le retour de réponse avec

NSURLProtectionSpace* protectionSpace = challenge.protectionSpace; 

NSURLAuthenticationMethodClientCertificate 

Et le problème est dans iOS 11 le retour de réponse:

NSURLAuthenticationMethodServerTrust 

Comment forcer que le retour de réponse NSURLAuthenticationMethodClientCertificate la premier tome au lieu de NSURLAuthenticationMethodServerTrust.

apprécierais toute aide :)

Répondre

0

Je vais répondre ici après quelques heures de recherche. Dans iOS 11 NSURLAuthenticationMethodServerTrust toujours arriver d'abord puis passer à NSURLAuthenticationMethodClientCertificate mais dans iOS 10, il fonctionne dans le sens opposé.