Tips and Tricks in a world of Mix

    
/// <summary>
    /// Handles a call to a web service via SSL that does not have a valid server certificate
    /// </summary>
    /// <example>
    /// locate this code at the authorization class before validating the web service
    /// System.Net.ServicePointManager.CertificatePolicy = new TrustAllCertificatePolicy();
    /// </example>
    public class TrustAllCertificatePolicy : System.Net.ICertificatePolicy
    {
        public TrustAllCertificatePolicy()
        { }

         public bool CheckValidationResult(ServicePoint sp,
         X509Certificate cert, WebRequest req, int problem)
        {
            return true;
        }
    }

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Tag Cloud

%d bloggers like this: