我正在尝试使用 SSL 证书连接到我的 Azure WCF 服务。我看过很多关于更改 web.config 文件中的“绑定(bind)”属性的教程,但我遵循的教程导致这是不可能的(据我所知):
我的 Azure 数据库中的数据使用我的 Azure 托管 WCF 服务公开,目前连接字符串包含敏感数据。
使用我的 SSL 证书(我最近购买了通配符 SSL 证书),我想从我的 WP7 应用连接到我的 Azure 托管 WCF 服务。
本质上我正在寻找一些指导:
- 如何在 WP7 应用和 Azure 托管的 WCF 服务之间设置 SSL 连接,以便只有该应用的用户才能访问该服务?
谢谢!
最佳答案
您需要做一些事情:
- 将客户端(WP7)和服务器(WCF 服务)配置为 use the basicHttpBinding with Security mode set to Transport 。这将允许您使用 HTTPS 端点。
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding allowCookies="True">
<security mode="Transport" />
</binding>
</basicHttpBinding>
</bindings>
</system.serviceModel>
- Upload the certificate in your cloud service通过门户网站。
- Add an HTTPS endpoint referencing the certificate (通过指纹)在 Web 角色(csdef 和 cscfg)中。
- Map a CNAME to your cloudapp address与您的证书中定义的通配符域相匹配。
关于wcf - 将 SSL 与 WP7、WCF 服务和 Azure 结合使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12335156/