Page 1 of 1
Auto Select Certificate
Posted: Wed Jan 10, 2024 12:35 am
by dux
Hello!
When accessing a HTTPS site, open the dialog box several times to select the certificate.
Is it possible for the component to select automatically?
I'm working on a VCL Forms project in Delphi 2006.
Re: Auto Select Certificate
Posted: Wed Jan 10, 2024 7:44 am
by salvadordf
Hi,
See the ClientCertsBrowser demo.
You need to implement the TWVBrowser.OnClientCertificateRequested event and create a TCoreWebView2ClientCertificateRequestedEventArgs instance.
Then set the TCoreWebView2ClientCertificateRequestedEventArgs.SelectedCertificate to one of the certificates in TCoreWebView2ClientCertificateRequestedEventArgs.MutuallyTrustedCertificates and set TCoreWebView2ClientCertificateRequestedEventArgs.Handled to True.
Read the code comments for the TWVBrowser.OnClientCertificateRequested event and TCoreWebView2ClientCertificateRequestedEventArgs to know more details.
Re: Auto Select Certificate
Posted: Wed Jan 10, 2024 6:56 pm
by dux
It worked!
Thanks!