3

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?

1
  • I am wondering if you can tweak registry to change the default behavior of your web browser, which should also works for your WebBrowser control used on the same machine
    – PerlDev
    Sep 16, 2010 at 13:34

2 Answers 2

3

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.

0

As noted by Marc Gravell, I don't believe that it is possible to use ServicePointManager or ServicePoint classes in the WebBrowser Control, nor do you need to though.

See my answer to your other post where you asked your original question.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.