user1567095
user1567095

Reputation: 480

Using SSL with WP7, WCF service and Azure

I'm trying to connect to my azure WCF service using an SSL certificate. I've seen a good few tutorials talking about changing the 'binding' properties in the web.config file but the tutorial I followed results in this not being possible (as far as I can see):

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

The data in my Azure database is exposed using my Azure hosted WCF service and at the moment, the connection string contains sensitive data.

Using my SSL certificate (I recently purchased a wildcard SSL certificate) I'd like to connect to my Azure hosted WCF service from my WP7 app.

Essentially I'm looking for some guidance:

Thanks!

Upvotes: 1

Views: 922

Answers (1)

Sandrino Di Mattia
Sandrino Di Mattia

Reputation: 24895

You'll need to do a few things:

  1. Configure both the client (WP7) and the server (WCF service) to use the basicHttpBinding with Security mode set to Transport. This will allow you to use an HTTPS endpoint.

<system.serviceModel>    
   <bindings>
     <basicHttpBinding>
       <binding allowCookies="True">
         <security mode="Transport" />
       </binding>
     </basicHttpBinding>
   </bindings>
</system.serviceModel>  
  1. Upload the certificate in your cloud service through the portal.
  2. Add an HTTPS endpoint referencing the certificate (through the thumbprint) in the Web Role (csdef and cscfg).
  3. Map a CNAME to your cloudapp address that matches the wildcard domain defined in your certificate.

Upvotes: 1

Related Questions