views:

405

answers:

1

Hello everyone,

I am using VSTS 2008 + C# + .Net 3.5 to develop a Silverlight 3 application and I need to access some https address on another web server (other than the server delivering the Silverlight application).

Here is my code which works with .Net 3.5 console application, But I cannot find class like ServicePointManager when using Silverlight. Any suggestions how to implement the same feature in Silverlight (accept all certificate from server).

public static void SetBypassSslCertificateValidation()
{
    ServicePointManager.ServerCertificateValidationCallback
        += new RemoteCertificateValidationCallback(BypassSslCertificateValidation);
}

private static bool BypassSslCertificateValidation(object sender, X509Certificate cert, X509Chain chain, SslPolicyErrors error)
{
    return true;
}

thanks in advance, George

+1  A: 

Silverlight leaves trust decisions for web services and other content to the web browser, since the BHWR (browser network stack) is used.

As a result, you cannot bypass certificate validation using any APIs in Silverlight.

You might be able to investigate special configuration options or security/zone settings for your web browser, if you're looking at using this for testing.

Jeff Wilcox