Page 1 of 1

How can I handle ERR_CERT_COMMON_NAME_INVALID (-200) error in CEF4Delphi for websites requiring digital certificates?

Posted: Mon May 27, 2024 1:02 am
by dgs
I have successfully accessed regular websites using CEF4Delphi. However, when accessing websites within an internal intranet that require a digital certificate (USB certificate key), I encounter the ERR_CERT_COMMON_NAME_INVALID (-200) error. Is there a way to prompt an error warning similar to Chrome, where users can click to confirm and proceed with accessing, or simply bypass the error to continue accessing?

Re: How can I handle ERR_CERT_COMMON_NAME_INVALID (-200) error in CEF4Delphi for websites requiring digital certificates

Posted: Mon May 27, 2024 1:54 pm
by salvadordf
Enabling the chrome runtime should give you the same error pages than Chrome.

Open the MiniBrowser demo and enable this line :
https://github.com/salvadordf/CEF4Delphi/blob/7c230b9d70b9bb47c334eb438c5be4f7d70bf576/demos/Delphi_VCL/MiniBrowser/uMiniBrowser.pas#L328

The upcoming CEF4Delphi with CEF 125 will have better support for Chrome runtime.

Re: How can I handle ERR_CERT_COMMON_NAME_INVALID (-200) error in CEF4Delphi for websites requiring digital certificates

Posted: Tue May 28, 2024 12:27 am
by dgs
Thank you! But I need to use it in a Windows 7 environment, so I can only use CEF version 109. Even when I set GlobalCEFApp.ChromeRuntime := True; the problem persists. Is it necessary to use version 124 or above of CEF?

Re: How can I handle ERR_CERT_COMMON_NAME_INVALID (-200) error in CEF4Delphi for websites requiring digital certificates

Posted: Tue May 28, 2024 2:52 pm
by salvadordf
Old CEF versions have an incomplete Chrome runtime implementation.

If you use CEF 109 you will have to use TChromiumCore.OnLoadError and TChromiumCore.OnCertificateError to show an error page.
https://github.com/salvadordf/CEF4Delphi/blob/e3cd6821c842f27ada58497cdd522f94ddd97868/demos/Delphi_VCL/MiniBrowser/uMiniBrowser.pas#L543
https://github.com/salvadordf/CEF4Delphi/blob/e3cd6821c842f27ada58497cdd522f94ddd97868/demos/Delphi_VCL/MiniBrowser/uMiniBrowser.pas#L1036

Re: How can I handle ERR_CERT_COMMON_NAME_INVALID (-200) error in CEF4Delphi for websites requiring digital certificates

Posted: Thu May 30, 2024 4:40 am
by dgs
Thank you very much!