Page 1 of 1
Which event does HTTPS website need to provide customer certificate?
Posted: Mon Nov 12, 2018 1:10 am
by yiqianyishi
Hi,
When visiting an HTTPS address, the website needs to provide a customer certificate. Maybe the system already exists or needs to be obtained from USBKEY. Other browsers can appear the Selection Certificate dialog box. How can CEF4 trigger this event? And how to submit the specified certificate to CEF4?
Re: Which event does HTTPS website need to provide customer certificate?
Posted: Mon Nov 12, 2018 7:30 am
by salvadordf
Hi,
Use the
TChromium.OnSelectClientCertificate event to select a client certificate.
These are the code comments about that event found here :
https://github.com/chromiumembedded/cef ... ler_capi.h
Code: Select all
///
// Called on the UI thread when a client certificate is being requested for
// authentication. Return false (0) to use the default behavior and
// automatically select the first certificate available. Return true (1) and
// call cef_select_client_certificate_callback_t::Select either in this
// function or at a later time to select a certificate. Do not call Select or
// call it with NULL to continue without using any certificate. |isProxy|
// indicates whether the host is an HTTPS proxy or the origin server. |host|
// and |port| contains the hostname and port of the SSL server. |certificates|
// is the list of certificates to choose from; this list has already been
// pruned by Chromium so that it only contains certificates from issuers that
// the server trusts.
///
For more info about that event and the callback read these pages :
https://magpcss.org/ceforum/apidocs3/pr ... ndler.html
https://magpcss.org/ceforum/apidocs3/pr ... lback.html
As far as I know, CEF3 only allows you to select local certificates. If you need to select certificates in smartcards or other external devices you will have to modify the CEF3 binaries. Read this post in the official CEF3 forum for more info :
https://www.magpcss.org/ceforum/viewtop ... 26&p=38683