Am găsit o soluție, trebuie să adăugați scrisorile de acreditare Keychain utilizatorului aici este codul meu
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)
Am recuperat mai întâi sharedCredentialStorage (1), apoi am creat noi NSURLCredential conținând numele meu de utilizator, parola și tipul de persistență de a utiliza (2). Dupa aceea, am creat două NSURLProtectionSpace (3) (4): unul pentru HTTPS Connexion și unul pentru Connexion HTTP
Și în final, am adăugat NSURLCredential sharedCredentialStorage pentru aceste ProtectionSpaces (5) (6)
Sper că acest cod vă poate ajuta