我们可以对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];
}谢谢
发布于 2011-06-09 22:17:26
我不确定Cassini是否有内置的身份验证级别,但我有点怀疑。我非常确定您应该能够使用IIS Express,它将取代Cassini。
查看有关IIS Express的Scott Guthrie's blog post。
https://stackoverflow.com/questions/6294208
复制相似问题