繁体   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