locked
How to trust or ignore the certificate with ReportViewer RRS feed

  • Question

  • I have been struggling with this for some time now.  My issue is I managed to setup a local domain certificate authority.  I accepted (imported) the host into my trusted root certificates in IE.  I am now able to view the ReportServer through IE and avoid the certificate warnings.  However this doesn't do anything for the ReportViewer control in my winform.  Which is still showing the error that the certificate is invalid.  Is there a way to tell ReportViewer to ignore certificate errors?  I need to verify the functionality of SSL through my app and this is the last thing.

     

    Thanks for your time and efforts

    Monday, September 3, 2007 3:49 PM

Answers

  • I have found a solution that will work. I posted it below

     

    in the OnLoad I added this

    ServicePointManager.ServerCertificateValidationCallback = RemoteCertificateValidationCB;

     

    later in the class I declared the following.

     

    public static bool RemoteCertificateValidationCB (Object sender, X509Certificate certificate,

    X509Chain chain, SslPolicyErrors sslPolicyErrors)

    {

    return true;

    }

     

    Monday, September 3, 2007 5:35 PM