Windows Phone 7 API + SSL

I'm trying to connect to an API, which is hosted on an SSL connection.

This is the crossdomain:

<?xml version="1.0"?>
<cross-domain-policy>
  <allow-access-from domain="*" secure="true" />
</cross-domain-policy>

That's all there is.

Now I try to connect, but I always get a security exception (no more info given).

Now the problem is that in Silverlight you have to have the Silverlight app hosted on ssl if you want to connect to an ssl service. (which I can understand).

But how do I enforce this for Windows Phone 7? It's not on ssl or something.

Worst thing: I don't know if the problem is the secure="true" part, since I cannot import a custom root cert in WP7 and thus I can't test locally with SSL.

The same code hosted on a non ssl solution works perfectly.

Any clues?

Answers


This works:

var base64Creds = Convert.ToBase64String(Encoding.UTF8.GetBytes(string.Format("{0}:{1}", "username", "password"))); 

webClient.Headers["Authorization"] = "Basic " + base64Creds;

.Credentials itself is not supported, so it seems.


Need Your Help

Retrieve Information from Registry Key Using PowerShell

windows powershell registry registrykey

I am using PowerShell to read information from the registry key.