I have instantiated a WebBrowser object. When I use it to Navigate to a specific URL I need it to get to, I get the following error message:
The website’s security certificate is not secure.
Error code: 0
The problem is that I can't get past this error on the WebBrowser.
However, if I go to the same URL using Internet Explorer 11, I get a similar (maybe the same?) error but with a little bit of more information:
Your PC doesn’t trust this website’s security certificate.
The hostname in the website’s security certificate differs from the website you are trying to visit.
Error Code: DLG_FLAGS_INVALID_CA
DLG_FLAGS_SEC_CERT_CN_INVALID
And it provides me the option Go on to the webpage (not recommended)
.
This is the code I'm using to navigate to the webpage:
WebBrowser wb = new WebBrowser();
wb.ScriptErrorsSuppressed = true;
wb.Navigate(url);
wb.Dock = DockStyle.Fill;
And later on I add wb
to Controls.
I need my application to either ignore the error and proceed to the webpage or to provide the option of going to the webpage in a similar fashion as Internet Explorer 11 does.
How can I do this?