Silverlight 4 WebRequest, SSL and Credentials
- by Snake
Hi,
I've got the following code:
public void StartDataRequest()
{
WebRequest.RegisterPrefix("https://", System.Net.Browser.WebRequestCreator.ClientHttp);
WebClient myService = new WebClient
{
AllowReadStreamBuffering = true,
UseDefaultCredentials = false,
Credentials = new NetworkCredential("username", "password")
};
myService.UseDefaultCredentials = false;
myService.OpenReadCompleted += this.RequestCompleted;
myService.OpenReadAsync(new Uri("Url"));
}
public void RequestCompleted(object sender, System.Net.OpenReadCompletedEventArgs e)
{
// ...
}
Now this works perfectly for, say, Twitter. But when I try to do it with another https service I get a security error.
This is probably because the website I try to connect too does not have a crossdomain.xml. Is there a way to bypass this? Or does the file really needs to be there?
Thanks.