-1

I'm currently using a System.Windows.Forms.WebBrowser in my program. When I try to access some websites over https, the message "There is a problem with your websites security certificate" appears. Is there any way I can get WebBrowser to ignore these types of warnings?

I am using Visual Studio 2010.

Ian R. O'Brien
  • 6,682
  • 9
  • 45
  • 73
user1681514
  • 97
  • 5
  • 13

1 Answers1

0

The simplest way is:

System.Net.ServicePointManager.ServerCertificateValidationCallback = 
  (sender, certificate, chain, errors) => true;

But that does leave the client vulnerable (i.e. cannot verify the server's identity).

A better approach would be to implement a method that actually validates the certificate, or if the certificate cannot be validated presents the user with a choice whether they should proceed or not.

Simon
  • 209
  • 1
  • 3