Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
How can I handle ERR_CERT_COMMON_NAME_INVALID (-200) error in CEF4Delphi for websites requiring digital certificates?
How can I handle ERR_CERT_COMMON_NAME_INVALID (-200) error in CEF4Delphi for websites requiring digital certificates?
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?
- salvadordf
- Posts: 4158
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: How can I handle ERR_CERT_COMMON_NAME_INVALID (-200) error in CEF4Delphi for websites requiring digital certificates
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.
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
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?
- salvadordf
- Posts: 4158
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: How can I handle ERR_CERT_COMMON_NAME_INVALID (-200) error in CEF4Delphi for websites requiring digital certificates
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
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