2013-02-28 5 views
1

이제 NSURLRequest을 서버 유효성 검사를위한 로컬 인증서와 함께 서버로 보내려고합니다. 그러나 NSURLRequest의 기능을 확인하면 인증서를 포함 할 방법을 찾을 수 없습니다. 누구든지 NSUrlRequest에 인증서를 포함시키는 방법을 알고 있습니까? 또는 ASIHttpRequest과 같은 오픈 소스 기능을 사용해야합니다.iPhone - 요청으로 인증서를 보내십시오.

답변

0

이 꽤 좋은 튜토리얼이 인증서를 제공하기 위해 NSURLConnectionDelegate 방법

- (void)connection:(NSURLConnection *)connection 
didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge 

를 사용하는 방법에 대해 설명합니다

Authenticating an HTTP Request with Client Certificates in iOS

에 모습을 제공하려고합니다. 도움이되는지 알려주세요.

UPDATE 단지 iOS 용의 경우 지원에 이> = 5.0이 제공되며,이

connection:willSendRequestForAuthenticationChallenge

+0

은 내가 말할 수있는 새로운 비 사용되지 않는 방법을 채택하는 것이 좋습니다 [challenge.sender useCredential : 자격 증명 forAuthenticationChallenge : 도전 ]는 서버에 인증서를 다시 전송합니다. –

+0

예 * credential *에 실제로 모든 인증서 데이터가 포함되어있는 경우 : NSURLCredential * credential = [NSURLCredential credentialWithIdentity : ID 인증서 : (NSArray *) certArray 지속성 : NSURLCredentialPersi stencePermanent]; –

+0

알았어, 고마워. –

관련 문제