I want to disable "Alert window" that I get from login page of one HTTPS site with "untrusted certificate".
ServicePointManager is used for WebRequest/WebResponse:
> public static bool > ValidateServerCertificate(object > sender, X509Certificate certificate, > X509Chain chain, SslPolicyErrors > sslPolicyErrors) { > return true; } > > ServicePointManager.ServerCertificateValidationCallback > = new RemoteCertificateValidationCallback(ValidateServerCertificate);
but how can I use it with Webbrowser control?
The ServicePointManager is for managed code; WebBrowser is a wrapper around shdocvw, so will almost certainly have a very different programming model.
if you can automate this (and I'm not sure that you can), I would expect to have to reference the COM version to get the full API (see: AxWebBrowser). WebBrowser only exposes a .NET-friendly subset of the full functionality - enough to get most common jobs done.
One other option might be to get the data yourself (WebClient / WebRequest / etc), and simply push that html into the WebBrowser - but this will mess up external links etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With