Page 1 of 1

Certificate in pfx file

Posted: Mon Feb 26, 2024 12:57 pm
by chemapa
Hello.

I need load a certificate from a pfx file. It's possible in OnSelectClientCertificate?

Else it's possible assing "on the fly" the know data to TCefX509Certificate created to call "callback.Select(aTCefX509Certificate)"? :?

Thanks

Re: Certificate in pfx file

Posted: Tue Feb 27, 2024 8:20 am
by salvadordf
Hi,

I'm afraid that's not possible.

These are the code comments for that event :
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 ICefSelectClientCertificateCallback.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.
Chromiun selects a few certificates installed in the operating system that the server trust.
You can only select one of those certificates.

CEF only allows us to wrap a certificate that Chromium selected in the OnSelectClientCertificate event using TCEFX509CertificateRef.
We can't create a new certificate.

Re: Certificate in pfx file

Posted: Tue Feb 27, 2024 5:38 pm
by chemapa
That's what I feared. Every parameters is const.

Thanks

:cry: