2011-10-06 91 views
0

NSURLCredential在響應身份驗證質詢時,是一種通過https連接發送密碼的安全方式?我認爲這會以安全的方式發送用戶名和密碼。加密,而不僅僅是作爲URL中的參數 - 這是正確的嗎?NSURLCredential是否通過https保護安全?

感謝您的回覆!

回答

0

是的,是的。 如果您正確回答委託方法,NSURLCredential是安全的。

1

如果您回答委託方法,它會安全地傳遞。

- (void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge { 
NSString *user = you user 
NSString *password = you pass; 

NSURLCredential *credential = [NSURLCredential credentialWithUser:user 
                 password:password 
                 persistence:NSURLCredentialPersistenceForSession]; 
[[challenge sender] useCredential:credential forAuthenticationChallenge:challenge]; 

}