Prompt to choose client certificate

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Prompt to choose client certificate

Postby paul2013 » Sat Jul 06, 2013 5:10 pm

Hi all, I'm using CEF3 and by trying out the cefclient demo I could verify that I cannot access web pages that request for a client certificate which on IE and Chrome would popup a window asking to choose the certificate to use if any and then the site loads, when I try to browse a page like that on the cefclient it simply doesn't go anywhere, no errors, nothing.
Is what I'm trying to do supported at all?

Chrome says: "Select a certificate to authenticate yourself to {URL}"
IE Says: "Select a Certificate"

Thanks!
paul2013
Techie
 
Posts: 17
Joined: Sat Jun 15, 2013 11:18 am

Re: Prompt to choose client certificate

Postby magreenblatt » Sun Jul 07, 2013 12:04 pm

CEF does not expose an interface for installing client certs. However, it uses the OS cert store so you should be able to install them yourself using OS functions. Cert errors are reported to CefRequestHandler::OnCertificateError.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Prompt to choose client certificate

Postby paul2013 » Mon Jul 08, 2013 9:21 am

magreenblatt wrote:CEF does not expose an interface for installing client certs. However, it uses the OS cert store so you should be able to install them yourself using OS functions. Cert errors are reported to CefRequestHandler::OnCertificateError.


Hi, the problem is, even though the certificate is installed the website won't load on the cefclient, on IE, Chrome and Firefox the user is always prompted to choose the certificate, even if there is just one certificate, on the cefclient it doesn't seem to read the certificate from the OS cert store, I added a breakpoint on OnCertificateError and even a message box but it doesn't get triggered.

Any ideas?
Thank you

Code: Select all
virtual bool OnCertificateError(
      cef_errorcode_t cert_error,
      const CefString& request_url,
      CefRefPtr<CefAllowCertificateErrorCallback> callback)
  {
     MessageBox(GetActiveWindow(), L"An error has ocurred.", L"Certificate Error", MB_OK | MB_ICONEXCLAMATION);
     return false;
  }
paul2013
Techie
 
Posts: 17
Joined: Sat Jun 15, 2013 11:18 am

Re: Prompt to choose client certificate

Postby magreenblatt » Tue Jul 09, 2013 11:45 am

paul2013 wrote:on IE, Chrome and Firefox the user is always prompted to choose the certificate

This means that you haven't installed it on the system. See for example http://blogs.technet.com/b/sbs/archive/ ... vista.aspx.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Prompt to choose client certificate

Postby paul2013 » Tue Jul 09, 2013 11:57 am

magreenblatt wrote:
paul2013 wrote:on IE, Chrome and Firefox the user is always prompted to choose the certificate

This means that you haven't installed it on the system. See for example http://blogs.technet.com/b/sbs/archive/ ... vista.aspx.


Thanks for sharing the link but I already have installed the trusted root certificate and user certificate and the website loads fine on all browsers without any warning whatsoever but it still won't load on the cefclient demo.
Any ideas?
paul2013
Techie
 
Posts: 17
Joined: Sat Jun 15, 2013 11:18 am

Re: Prompt to choose client certificate

Postby magreenblatt » Tue Jul 09, 2013 12:04 pm

You'll have to debug the code to find out what's going on. You can build CEF/Chromium from source as described at https://code.google.com/p/chromiumembed ... ndBuilding.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Prompt to choose client certificate

Postby DoiSuthep » Sun Oct 13, 2013 12:02 pm

Hi,

I'm having same issue. OnLoadError just gives -3 instead of prompt-dialog.
Adding register-key does not help:
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Chromium\AutoSelectCertificateForUrls]

Anyone solved or have ideas?
DoiSuthep
Newbie
 
Posts: 2
Joined: Sun Oct 13, 2013 11:58 am

Re: Prompt to choose client certificate

Postby mikematusiak » Thu Nov 21, 2013 7:06 am

Hey,
To get prompted for the certificate is quite complicated thing. I spent few days implementing this feature for CEF (for release branch 1650). The implementation mostly reuses the existing code for the chromium certificate selector. Before releasing this patch I would like to test it bit more and actually create patch based on trunk sources instead of release branch.
mikematusiak
Newbie
 
Posts: 1
Joined: Fri Nov 15, 2013 3:54 am

Re: Prompt to choose client certificate

Postby jdavmo » Sun Jan 12, 2014 11:33 pm

Hi mikematusiak

That is really good news that you have been able to patch CEF.

I would really like to try out the patch in its current form, would you mind providing the current version in the meantime while you are preparing the trunk version?

Thanks in advance!
jdavmo
Newbie
 
Posts: 1
Joined: Mon Jan 13, 2014 12:42 am

Re: Prompt to choose client certificate

Postby paul2013 » Wed Jan 15, 2014 2:58 pm

mikematusiak wrote:Hey,
To get prompted for the certificate is quite complicated thing. I spent few days implementing this feature for CEF (for release branch 1650). The implementation mostly reuses the existing code for the chromium certificate selector. Before releasing this patch I would like to test it bit more and actually create patch based on trunk sources instead of release branch.


That's great news, I would like to test.
paul2013
Techie
 
Posts: 17
Joined: Sat Jun 15, 2013 11:18 am

Next

Return to Support Forum

Who is online

Users browsing this forum: No registered users and 210 guests