About Me

Followers

My Visual Studio Achievements

Twitter

Monday, November 28, 2011

The days are again getting tight due to new technologies like Windows Azure, Windows Phone 7 & iPhone development. It is always interesting to work in new technologies where we learn so many new things ,hacks etc…My recent project uses Windows Azure as server side technology and mobile as client side. For the time being we are using iPhone as client.

When we start with Azure we could see that we can simulate the https scenario even in the emulator which is more like the production environment. Really like it. But after some time, it became trouble. There were not enough MAC machines where we can test the iPhone application. So I moved to WP 7 as client for testing purpose. I integrated the Azure tool kit for WP 7 and when tried to access the Azure ACS, it started throwing errors .Our REST based services hosted using HTTPS in emulator are not working. ie simply says network error.

After a google we could see that it is due to lack of certificates. If it was some other .Net client I can live with ServicePointManager and its validation callback. But unfortunately there is no such ServicePointManager in Silverlight. So it is proved that WP7 never allows you to access the https url without proper certificate. But how to install certs in WP7 .When I asked my fellow developer who has Windows Phone, he told that he normally send the certificate file (.cer)through mail and the opening of attachment in phone will prompt for installation.

But where is the mail client in simulator. Tried to send to my gmail id. But no luck.Then I tried the next way. Export the certificate into .cer format, host the .cer file in IIS and access it from Phone’s browser.Yes it worked. I was able to install the certificate. But again I got error in getting data through REST service. That was due to certificate URL issue .I should have used the exact certificate which is created for the IIS. ie for the localhost/127.0.0.1.

Below are the steps to install the certificate in WP7 and get the Azure REST services working which is hosted in Azure emulator.

Export the certificate as .cer

The certificate should be for the exact web address. ie export the certificate for 127.0.0.1 from IIS.