c# - Where to place RemoteCertificateValidationCallback? -


i have same problem here: how disable "security alert" window in webbrowser control

i answer, going place servicepointmanager.servercertificatevalidationcallback = new remotecertificatevalidationcallback(validateservercertificate);?

i 'invalid certification' message after submit login page of school network code:

htmlelementcollection ellements = webbrowser.document.getelementsbytagname("input"); foreach (htmlelement ellement in ellements) {     if (ellement.outerhtml == "<input onclick=\"this.value = 'submitted'\" value=\" login \" type=submit>")     {         ellement.invokemember("click");         this.dialogresult = dialogresult.ok;         break;     } } 

thank much. :)

you should put following @ any point before show web browser control / submit page:

servicepointmanager.servercertificatevalidationcallback +=      new remotecertificatevalidationcallback((sender, certificate, chain, policyerrors) => { return true; }); 

(this same example answer in linked question, callback method anonymous little more compact).


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -