I am developing an application in Silverlight which communicates with a remote server over SSL, here is the code
private void button1_Click(object sender, RoutedEventArgs e)
{
WebClient wc = new WebClient();
wc.DownloadStringCompleted += new DownloadStringCompletedEventHandler(wc_DownloadStringCompleted);
wc.DownloadStringAsync(new Uri("https://192.168.3.31:8000"));
}
void wc_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
{
Console.WriteLine(e);
}
I want to differentiate between errors when the "Server is down" and "SSL certificate is not installed on client machine", but the wc_DownloadStringCompleted
shows the same message in both cases i.e. "The remote server returned an error: NotFound.". It should be different in case when SSL certificate problem occurs. I am using Visual Studio 2010 and Silverlight 4. Any help?