cefsharp / CefSharp

.NET (WPF and Windows Forms) bindings for the Chromium Embedded Framework
http://cefsharp.github.io/
Other
9.76k stars 2.92k forks source link

OnCertificateError are not fired on inner resources #4864

Closed Speed7811 closed 1 week ago

Speed7811 commented 1 week ago

Is there an existing issue for this?

CefSharp Version

126.2.70.0

Operating System

Windows 11

Architecture

x64

.Net Version

.NET 4.8

Implementation

WinForms

Reproduction Steps

  1. Clear ChromiumWebBrowser cache (directory)
  2. Use a website which contains a Javascript. This Javascript executes a"fetch"-Method to an URL with a self signed certificate (e.g. https://self-signed.badssl.com/)
  3. Create a new ChromiumWebBrowser instance and set as RequestHandler a handler which overrides "OnCertificateError". In "OnCertificateError" accept any certificate.
  4. Load the website

Expected behavior

"OnCertificateError" should be fired when the javascript fetch will be executed.

Actual behavior

OnCertificateError will not fired.

Regression?

No response

Known Workarounds

If I set in the global settings "IgnoreCertificateErrors" to true it works. The problem is here I cannot use it because we have in the same process two browser instances. I need the certificate ignore flag only on one instance or for one url. Maybe somebody knows a setting for doing this.

Does this problem also occur in the CEF Sample Application

Not Tested

Other information

No response

amaitland commented 1 week ago

Closing as this is a known limitation.

https://github.com/chromiumembedded/cef/blob/231701d98b1427a41a75098bd6bd3bd803f9dacc/libcef/browser/certificate_query.cc#L93

Not something that can be changed directly in CefSharp.