簡體   English   中英

NSURLCredential是否通過https安全?

[英]Is NSURLCredential secure over https?

NSURLCredential是響應身份驗證挑戰時通過https連接發送密碼的安全方法嗎? 我假設這以安全的方式發送用戶名和密碼。 加密,而不僅僅是作為url中的參數-這是正確的嗎?

感謝您的回復!

如果您回答委托方法,則將安全地傳遞它。

- (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];

}

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM