Ios HTTPS+;表单登录连接

Ios HTTPS+;表单登录连接,ios,authentication,login,nsurlconnection,Ios,Authentication,Login,Nsurlconnection,我正在使用HTTPS登录表单页面。 当通过 - (void)connection:(NSURLConnection *)connection willSendRequestForAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge` 以及提取通过 NSString *authenticationMethod = [[challenge protectionSpace] authenticationMethod];

我正在使用HTTPS登录表单页面。 当通过

- (void)connection:(NSURLConnection *)connection willSendRequestForAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge` 
以及提取通过

NSString *authenticationMethod = [[challenge protectionSpace] authenticationMethod];
我得到以下信息

NSURLAuthenticationMethodServerTrust
但预期的结果应该是

NSURLAuthenticationMethodHTMLForm
这是因为使用了HTTPS吗?

简短回答:是

nsurauthenticationmethodservertrust
authenticationmethod的目的是,客户机可以验证并信任服务器是否是它假装的服务器

nsurAuthenticationMethodHtmlForm
用于通过web表单对用户进行身份验证。服务器发送web表单并请求用户凭据。此身份验证不需要通过SSL/TLS发送。但是,用户的凭证将以明文形式发送,从安全角度来看,这是一件坏事

客户端身份验证也是TLS协议的一部分。在这种情况下,您可能会收到一个质询,其方法是
nsurauthenticationmethodclientcertificate

请注意,您可能会收到多个身份验证挑战