2011-06-09 78 views
0

我們可以使用以下方法來超卡西尼嗎?因爲我知道這是非常好,IIS卡西尼SSL認證

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

謝謝

回答

1

我不知道如果卡西尼有內置的身份驗證的水平,但我有點懷疑。我很肯定你應該能夠使用IIS Express,它將取代卡西尼。

檢出有關IIS Express的Scott Guthrie's blog post

+0

你是對的,卡西尼沒有身份驗證和HTTPS,我也發現HTTPS可以使用ultiDev卡西尼網絡服務器使用HttpVPN代理...並感謝您的鏈接和您的評論。 – Pooja 2011-07-14 16:08:50