2013-03-06 1 views
0

HTTP/HTTPS 요청을 더 빨리 수행하기 위해 Objective-C 코드를 개발 중입니다. 이 코드는 가장 자주 수행되는 조작이 들어있는 라이브러리에 삽입됩니다. 인증이 필요한 HTTPS 요청을 테스트하는 서버를 찾고 있습니다.HTTPS 인증 테스트

특히 iOS 표준 라이브러리에는 NSURLConnection 클래스가 있습니다. NSURLConnectionDelegate 프로토콜에는 connection : didReceiveAuthenticationChallenge : 메서드가 있습니다.이 클래스를 사용하여 테스트하고 싶습니다.

뭔가 있나요? Google에서 검색했지만 찾은 것이 없습니다.

답변

1

네 당신이 바로, 당신이 NSURLConnectionDelegate에서 didReceiveAuthenticationChallenge를 사용해야합니다 여기에 몇 가지 사용 예를

- (BOOL)connection:(NSURLConnection *)connection canAuthenticateAgainstProtectionSpace:(NSURLProtectionSpace *)protectionSpace { 
    return YES; 
} 
- (void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge { 
    [challenge.sender useCredential:[NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust] forAuthenticationChallenge:challenge]; 
} 
+0

감사합니다,하지만 난 통해 이러한 방법을 테스트 서버에 대해 찾고 있어요. – Massimo