我正在努力解决这个问题,而且我遇到了在没有经过身份验证的SSL证书的情况下连接到HTTPS站点的麻烦。
How to print formatted text from a web server with confirmation of successful printing?
使用WebBrowser控件时,此解决方案允许我连接。
ServicePointManager.ServerCertificateValidationCallback = new System.Net.Security.RemoteCertificateValidationCallback(AcceptAllCertifications);
public bool AcceptAllCertifications(object sender, System.Security.Cryptography.X509Certificates.X509Certificate certification, System.Security.Cryptography.X509Certificates.X509Chain chain, System.Net.Security.SslPolicyErrors sslPolicyErrors)
{
return true;
}
但是当使用SHDocVw的Internet Explorer对象时,我又回来收到有关安全证书的错误。
如何在没有用户输入的情况下使用Internet Explorer对象并允许连接到没有经过身份验证的证书的站点?