ios - 使用 Cassini 进行 SSL 身份验证

标签 ios iis ssl nsurlconnection cassini

我们可以对 ultra cassini 使用以下方法吗?据我所知,IIS 非常好

- (BOOL)connection:(NSURLConnection *)connection canAuthenticateAgainstProtectionSpace:(NSURLProtectionSpace *)protectionSpace {
  return [protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust];
}

- (void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge {
  if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust])
    if ([trustedHosts containsObject:challenge.protectionSpace.host])
      [challenge.sender useCredential:[NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust] forAuthenticationChallenge:challenge];

  [challenge.sender continueWithoutCredentialForAuthenticationChallenge:challenge];
}

谢谢

最佳答案

我不确定 Cassini 是否内置了身份验证级别,但我有点怀疑。我很确定您应该能够使用 IIS Express,它将取代 Cassini。

查看 Scott Guthrie's blog post关于 IIS Express。

关于ios - 使用 Cassini 进行 SSL 身份验证,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6294208/

相关文章:

ios - 了解 ISO mp4 m4a 元数据

iis - 在 IIS 中为默认网站配置 SSL 后 https url 未打开

ios - 使用 dataWithContentsOfURL 时的空格式 JSON 文件

objective-c - 如何使用函数?

ios - Xcode 4.3.1 纹理工具丢失了吗?

apache 重写 POST 请求 SSL https mod_rewrite

c# - 通过 C# 和 HttpWebRequest 抓取安全网站时出现 SSL/TLS 错误

iis - 具有不同 .net 框架的虚拟目录

windows - IIS 6.0 调试方法

php - 通过 SSL 的 Twitter 搜索小部件