屏蔽ssl验证即可
Browser.RequestHandler = new ExampleRequestHandler();
public class ExampleRequestHandler : RequestHandler
{
protected override bool OnCertificateError(IWebBrowser chromiumWebBrowser, IBrowser browser, CefErrorCode errorCode, string requestUrl, ISslInfo sslInfo, IRequestCallback callback)
{
Task.Run(() =>
{
if (!callback.IsDisposed)
{
using (callback)
{
//地址包含报表成分 跳过ssl验证
if (requestUrl.Contains("reportSystem"))
{
callback.Continue(true);//重点部分
}
else
{
callback.Continue(false);
}
}
}
});
return true;
}
}
[参考]
Cefsharp开发中遇到的问题