J'ai trouvé une solution, nous devons ajouter au trousseau de vérification des pouvoirs de l'utilisateur voici mon code
NSURLCredentialStorage * credentialStorage=[NSURLCredentialStorage sharedCredentialStorage]; //(1)
NSURLCredential * newCredential;
newCredential=[NSURLCredential credentialWithUser:@"myUserName" password:@"myPWD" persistence:NSURLCredentialPersistencePermanent]; //(2)
NSURLProtectionSpace * mySpaceHTTP=[[NSURLProtectionSpace alloc] initWithProxyHost:@"ipProxy" port:port type:NSURLProtectionSpaceHTTPProxy realm:nil authenticationMethod:nil]; //(3)
NSURLProtectionSpace * mySpaceHTTPS=[[NSURLProtectionSpace alloc] initWithProxyHost:@"ipProxy" port:port type:NSURLProtectionSpaceHTTPSProxy realm:nil authenticationMethod:nil]; //(4)
[credentialStorage setCredential:newCredential forProtectionSpace:mySpaceHTTP]; //(5)
[credentialStorage setCredential:newCredential forProtectionSpace:mySpaceHTTPS]; //(6)
Je revins d'abord le sharedCredentialStorage (1), alors je créé de nouveaux NSURLCredential contenant mon nom d'utilisateur, mot de passe et le type de persistance à utiliser (2). Après cela, je créé deux NSURLProtectionSpace (3) (4): une pour HTTPS Connexion, et une connexion HTTP pour
Et enfin, j'ai ajouté NSURLCredential la sharedCredentialStorage pour ces ProtectionSpaces (5) (6)
J'espère que ce code peut vous aider