<p>I'm using Webbrowser control to login to HTTPS site with "untrusted certificate".
but I get popup such standart window "Security Alert" about untrusted certificate:</p>

<p><img src="https://i.stack.imgur.com/U01dp.jpg" alt="Security Alert window"></p>

<p>I have to find this window by title and send it <kbd>Alt</kbd>+<kbd>Y</kbd> to press <em>Yes</em>:</p>

<pre><code>int iHandle = NativeWin32.FindWindow(null, "Security Alert");
NativeWin32.SetForegroundWindow(iHandle);
System.Windows.Forms.SendKeys.Send("Y%");
</code></pre>

<p>but user can see a flickering of this window.</p>

<p>How can I ignore this alert?<br>
Or disable this "untrusted certificate" check in Webbrowser control?</p>

This should do it:
```
```
public static bool ValidateServerCertificate(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
{
    return true;
}

ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(ValidateServerCertificate);
```
```
Obviously, blindingly allowing certificates is a security risk.  Be careful.