mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Always pass callback object to CefRequestHandler::OnCertificateError (issue #1795)
This commit is contained in:
@ -229,10 +229,9 @@ typedef struct _cef_request_handler_t {
|
|||||||
// Called on the UI thread to handle requests for URLs with an invalid SSL
|
// Called on the UI thread to handle requests for URLs with an invalid SSL
|
||||||
// certificate. Return true (1) and call cef_request_tCallback::cont() either
|
// certificate. Return true (1) and call cef_request_tCallback::cont() either
|
||||||
// in this function or at a later time to continue or cancel the request.
|
// in this function or at a later time to continue or cancel the request.
|
||||||
// Return false (0) to cancel the request immediately. If |callback| is NULL
|
// Return false (0) to cancel the request immediately. If
|
||||||
// the error cannot be recovered from and the request will be canceled
|
// CefSettings.ignore_certificate_errors is set all invalid certificates will
|
||||||
// automatically. If CefSettings.ignore_certificate_errors is set all invalid
|
// be accepted without calling this function.
|
||||||
// certificates will be accepted without calling this function.
|
|
||||||
///
|
///
|
||||||
int (CEF_CALLBACK *on_certificate_error)(struct _cef_request_handler_t* self,
|
int (CEF_CALLBACK *on_certificate_error)(struct _cef_request_handler_t* self,
|
||||||
struct _cef_browser_t* browser, cef_errorcode_t cert_error,
|
struct _cef_browser_t* browser, cef_errorcode_t cert_error,
|
||||||
|
@ -265,10 +265,9 @@ class CefRequestHandler : public virtual CefBase {
|
|||||||
// Called on the UI thread to handle requests for URLs with an invalid
|
// Called on the UI thread to handle requests for URLs with an invalid
|
||||||
// SSL certificate. Return true and call CefRequestCallback::Continue() either
|
// SSL certificate. Return true and call CefRequestCallback::Continue() either
|
||||||
// in this method or at a later time to continue or cancel the request. Return
|
// in this method or at a later time to continue or cancel the request. Return
|
||||||
// false to cancel the request immediately. If |callback| is empty the error
|
// false to cancel the request immediately. If
|
||||||
// cannot be recovered from and the request will be canceled automatically.
|
// CefSettings.ignore_certificate_errors is set all invalid certificates will
|
||||||
// If CefSettings.ignore_certificate_errors is set all invalid certificates
|
// be accepted without calling this method.
|
||||||
// will be accepted without calling this method.
|
|
||||||
///
|
///
|
||||||
/*--cef()--*/
|
/*--cef()--*/
|
||||||
virtual bool OnCertificateError(
|
virtual bool OnCertificateError(
|
||||||
|
@ -710,14 +710,13 @@ void CefContentBrowserClient::AllowCertificateError(
|
|||||||
|
|
||||||
CefRefPtr<CefSSLInfo> cef_ssl_info = new CefSSLInfoImpl(ssl_info);
|
CefRefPtr<CefSSLInfo> cef_ssl_info = new CefSSLInfoImpl(ssl_info);
|
||||||
|
|
||||||
CefRefPtr<CefAllowCertificateErrorCallbackImpl> callbackImpl;
|
CefRefPtr<CefAllowCertificateErrorCallbackImpl> callbackImpl(
|
||||||
if (overridable && !strict_enforcement)
|
new CefAllowCertificateErrorCallbackImpl(callback));
|
||||||
callbackImpl = new CefAllowCertificateErrorCallbackImpl(callback);
|
|
||||||
|
|
||||||
bool proceed = handler->OnCertificateError(
|
bool proceed = handler->OnCertificateError(
|
||||||
browser.get(), static_cast<cef_errorcode_t>(cert_error),
|
browser.get(), static_cast<cef_errorcode_t>(cert_error),
|
||||||
request_url.spec(), cef_ssl_info, callbackImpl.get());
|
request_url.spec(), cef_ssl_info, callbackImpl.get());
|
||||||
if (!proceed && callbackImpl.get())
|
if (!proceed)
|
||||||
callbackImpl->Disconnect();
|
callbackImpl->Disconnect();
|
||||||
|
|
||||||
*result = proceed ? content::CERTIFICATE_REQUEST_RESULT_TYPE_CONTINUE :
|
*result = proceed ? content::CERTIFICATE_REQUEST_RESULT_TYPE_CONTINUE :
|
||||||
|
Reference in New Issue
Block a user