将SSL与WP7,WCF服务和Azure一起使用

时间:2012-09-08 23:02:25

标签: wcf windows-phone-7 ssl azure ssl-certificate

我正在尝试使用SSL证书连接到我的azure WCF服务。我看过很多关于改变web.config文件中'绑定'属性的教程,但我所遵循的教程导致这种情况无法实现(据我所知):

http://www.silverlightshow.net/items/Producing-and-Consuming-OData-in-a-Silverlight-and-Windows-Phone-7-application-Part-4.aspx

我的Azure数据库中的数据是使用我的Azure托管的WCF服务公开的,目前,连接字符串包含敏感数据。

使用我的SSL证书(我最近购买了通配符SSL证书)我想从我的WP7应用程序连接到我的Azure托管WCF服务。

基本上我正在寻找一些指导:

  • 如何在我的WP7应用和Azure托管的WCF服务之间设置SSL连接,以便只有该应用的用户才能访问该服务?

谢谢!

1 个答案:

答案 0 :(得分:1)

你需要做一些事情:

  1. 将客户端(WP7)和服务器(WCF服务)配置为use the basicHttpBinding with Security mode set to Transport。这将允许您使用HTTPS端点。

  2. <system.serviceModel>    
       <bindings>
         <basicHttpBinding>
           <binding allowCookies="True">
             <security mode="Transport" />
           </binding>
         </basicHttpBinding>
       </bindings>
    </system.serviceModel>  
    
    1. Upload the certificate in your cloud service通过门户网站。
    2. Web角色中的
    3. Add an HTTPS endpoint referencing the certificate(通过指纹)(csdef和cscfg)。
    4. Map a CNAME to your cloudapp address与证书中定义的通配符域匹配。