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.

Auto Select Certificate

Post Reply
dux
Posts: 2
Joined: Wed Jan 10, 2024 12:30 am

Auto Select Certificate

Post 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.
You do not have the required permissions to view the files attached to this post.
User avatar
salvadordf
Posts: 4079
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Auto Select Certificate

Post 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.
dux
Posts: 2
Joined: Wed Jan 10, 2024 12:30 am

Re: Auto Select Certificate

Post by dux »

It worked!

Thanks!
Post Reply