Handling the certificates in cef client

Do not post support requests, bug reports or feature requests. Discuss CEF here. Non-CEF related discussion goes in General Discussion!

Handling the certificates in cef client

Postby prasannamavinakuli » Wed Oct 09, 2013 12:11 am

Hello, All.

I am trying to open an URL which asks for the certificate. I see the discussion URL viewtopic.php?f=6&t=10822 saying that cef client supports only OS Level certificates. I tried using OS certificates - It did not work. However in our scenario we can't ask the user/customer to install the certificate at the OS Level. so we thought of doing other alternative approach. I tried to handle this in OnLoadError. But even if we explicitly try to load, we again got into the same problem.

Also, I tried of using the APIs mentioned in viewtopic.php?f=6&t=10822. But I get the compilation error for unable to see the class - CefAllowCertificateErrorCallback and also I don't see any virtual functions defined already.

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;
}

Is this method available only for C# interface and not in C++. we are using 3.0 is it available in next revisions? Can you please help us to understand and resolve this issue

Thanks and Regards
Prasanna.
prasannamavinakuli
Newbie
 
Posts: 6
Joined: Thu Jun 13, 2013 4:03 am

Re: Handling the certificates in cef client

Postby magreenblatt » Wed Oct 09, 2013 12:49 am

The OnCertificateError callback is available in the 3.1453 branch and newer.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Handling the certificates in cef client

Postby prasannamavinakuli » Wed Oct 09, 2013 1:00 am

Thank you so much for the reply! can we assume that if we upgrade to that particular version, can we override that method and can we bypass the certificate check?

Thanks
Prasanna.
prasannamavinakuli
Newbie
 
Posts: 6
Joined: Thu Jun 13, 2013 4:03 am

Re: Handling the certificates in cef client

Postby magreenblatt » Wed Oct 09, 2013 1:13 am

You can bypass some certificate checks like self-signed. If the certificate is completely invalid it still won't work. In that case you're not getting any security from it anyways and you're better off using HTTP.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Handling the certificates in cef client

Postby prasannamavinakuli » Wed Oct 09, 2013 1:15 am

Thanks Again! does it need to be imported to OS to bypass the particular certificate or we can ignore the valid self signed certificates in the code itself without asking user to import it to OS?

Thanks
Prasanna.
prasannamavinakuli
Newbie
 
Posts: 6
Joined: Thu Jun 13, 2013 4:03 am

Re: Handling the certificates in cef client

Postby magreenblatt » Wed Oct 09, 2013 2:06 am

You can accept self-signed certificates in the code. They still need to be delivered by the server (there is no certificate import capability).
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Handling the certificates in cef client

Postby prasannamavinakuli » Wed Oct 09, 2013 2:59 am

Thank you very much for the clarification. May be once I move to next version I will come back to you in case any clarifications needed
prasannamavinakuli
Newbie
 
Posts: 6
Joined: Thu Jun 13, 2013 4:03 am


Return to CEF Discussion

Who is online

Users browsing this forum: No registered users and 103 guests