开发者

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?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜