【问题标题】:HowTo: iPhone Web Service call to WCF Service with Certificate Authentication如何:iPhone Web 服务调用带有证书身份验证的 WCF 服务
【发布时间】:2011-01-14 23:56:38
【问题描述】:

我们是一家 .Net 商店,目前正在开发一款 iPhone 应用程序,该应用程序需要该应用程序调用 WCF Web 服务。我们的 WCF 服务使用用于身份验证的 x509 证书进行保护。

我一直在互联网上搜索有关如何执行以下操作的示例:

  1. 使用 iPhone 应用部署证书。
  2. 在对 WCF 服务的 Web 服务调用中使用该证书。

任何关于如何实现这一点的见解将不胜感激。

【问题讨论】:

标签: iphone wcf windows-authentication x509certificate


【解决方案1】:

可以在异步模式下使用 NSURLConnection API。您需要使用 NSURLConnectionDelegate 协议(http://developer.apple.com/library/mac/#documentation/Foundation/Reference/NSURLConnectionDelegate_Protocol/Reference/Reference.html#//apple_ref/occ/intf/NSURLConnectionDelegate) 实现一个对象。

当服务器质询证书时,委托将调用 connection:didReceiveAuthenticationChallenge: 方法。

有关 URL 加载系统,请参阅 Apple 指南(http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/URLLoadingSystem/Articles/AuthenticationChallenges.html#//apple_ref/doc/uid/TP40009507-SW1)

要从捆绑包中加载 SSL 证书,请参阅StackOverflow answer

【讨论】:

    猜你喜欢
    • 2011-01-15
    • 2018-03-28
    • 1970-01-01
    • 1970-01-01
    • 2013-07-05
    • 2015-03-19
    • 2011-11-11
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多