2011-10-10 6 views
0

정확히 xcode에서 내가 갖고있는 x.509 인증서를 어디에 두어야하는지 알고 싶었습니다. 여기에서 예제를 얻으십시오 : http://code.google.com/p/cocoaasyncsocket/downloads/detail?name=CertTest.zip&can=1&q=x.509 인증서를 사용하는 SSL 코코아

나는 실행중인 보안 서버와 통신 할 수 있기를 원했습니다. 난 그냥 인증서를 추가 할 것 같아요 때마다, 내 Mac 인증서를 내 시스템 (내 프로젝트가 아닌) 설정 중 하나가 속한 m 묻는 키를 창을 열립니다. 그래서 내 프로젝트에서 어디에 배치해야하는지 알고 싶습니다. 어떻게 사용합니까? (링크의 프로젝트가 도움이 될 것 같습니다)

+0

당신은 서버에 인증하기 위해 우리 인증서 하시겠습니까? – Nekto

+0

예. 맞습니다. 나는 인증을 끝내는 것 같다. –

답변

0

서버 연결에 NSURLConnection을 사용하는 경우 대리인에 다음 방법 : 당신은 애플이 샘플을 통해 보는

- (BOOL)connection:(NSURLConnection *)conn canAuthenticateAgainstProtectionSpace:(NSURLProtectionSpace *)protectionSpace; 
// A delegate method called by the NSURLConnection when something happens with the 
// connection security-wise. We defer all of the logic for how to handle this to 
// the ChallengeHandler module (and it's very custom subclasses). 


- (void)connection:(NSURLConnection *)conn didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge 
// A delegate method called by the NSURLConnection when you accept a specific 
// authentication challenge by returning YES from -connection:canAuthenticateAgainstProtectionSpace:. 
// Again, most of the logic has been shuffled off to the ChallengeHandler module; the only 
// policy decision we make here is that, if the challenge handle doesn't get it right in 5 tries, 
// we bail out. 

I 조언 : Advanced Url Connections

+0

아 예. 그게 효과가있다. 감사! 그 예를 알지 못했습니다. –

관련 문제