summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKirill Burtsev <kirill.burtsev@qt.io>2019-08-14 18:37:35 +0200
committerKirill Burtsev <kirill.burtsev@qt.io>2019-08-29 16:30:09 +0000
commit83c5182c998b74858c5c28fcf2feb1d4e07754bb (patch)
treef223bb281a34a7f2499d7b9fd8037d84929a8942
parentc75c3670e44bb848b043918fb742a86e5fba780d (diff)
Fix reporting overridable flag for QML WebEngineCertificateError type
Also remove confusion inside CertificateErrorController constructor and overridable method by matching documentation for AllowCertificateError method of ContentBrowserClient api. Change-Id: I7e10ef71a4429dcf5acc4b714a8a45f67a2ec684 Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
-rw-r--r--src/core/certificate_error_controller.cpp6
-rw-r--r--src/core/certificate_error_controller_p.h4
-rw-r--r--src/core/content_browser_client_qt.cpp2
-rw-r--r--src/webenginewidgets/api/qwebenginepage.cpp2
4 files changed, 7 insertions, 7 deletions
diff --git a/src/core/certificate_error_controller.cpp b/src/core/certificate_error_controller.cpp
index a747451d..3309db8f 100644
--- a/src/core/certificate_error_controller.cpp
+++ b/src/core/certificate_error_controller.cpp
@@ -79,14 +79,14 @@ CertificateErrorControllerPrivate::CertificateErrorControllerPrivate(int cert_er
const net::SSLInfo& ssl_info,
const GURL &request_url,
content::ResourceType resource_type,
- bool _overridable,
+ bool fatal_error,
bool strict_enforcement,
const base::Callback<void(content::CertificateRequestResultType)>& cb
)
: certError(CertificateErrorController::CertificateError(cert_error))
, requestUrl(toQt(request_url))
, resourceType(CertificateErrorController::ResourceType(resource_type))
- , overridable(_overridable)
+ , fatalError(fatal_error)
, strictEnforcement(strict_enforcement)
, callback(cb)
{
@@ -118,7 +118,7 @@ QUrl CertificateErrorController::url() const
bool CertificateErrorController::overridable() const
{
- return d->overridable;
+ return !d->fatalError && !d->strictEnforcement;
}
bool CertificateErrorController::strictEnforcement() const
diff --git a/src/core/certificate_error_controller_p.h b/src/core/certificate_error_controller_p.h
index abde9a7d..3b4d0f3b 100644
--- a/src/core/certificate_error_controller_p.h
+++ b/src/core/certificate_error_controller_p.h
@@ -59,7 +59,7 @@ QT_BEGIN_NAMESPACE
class CertificateErrorControllerPrivate {
public:
- CertificateErrorControllerPrivate(int cert_error, const net::SSLInfo& ssl_info, const GURL& request_url, content::ResourceType resource_type, bool overridable, bool strict_enforcement, const base::Callback<void(content::CertificateRequestResultType)>& callback);
+ CertificateErrorControllerPrivate(int cert_error, const net::SSLInfo& ssl_info, const GURL& request_url, content::ResourceType resource_type, bool fatal_error, bool strict_enforcement, const base::Callback<void(content::CertificateRequestResultType)>& callback);
void accept(bool accepted);
@@ -68,7 +68,7 @@ public:
QDateTime validStart;
QDateTime validExpiry;
CertificateErrorController::ResourceType resourceType;
- bool overridable;
+ bool fatalError;
bool strictEnforcement;
const base::Callback<void(content::CertificateRequestResultType)> callback;
};
diff --git a/src/core/content_browser_client_qt.cpp b/src/core/content_browser_client_qt.cpp
index 0a51cc26..acd652b1 100644
--- a/src/core/content_browser_client_qt.cpp
+++ b/src/core/content_browser_client_qt.cpp
@@ -355,7 +355,7 @@ void ContentBrowserClientQt::AllowCertificateError(content::WebContents *webCont
ssl_info,
request_url,
resource_type,
- !IsCertErrorFatal(cert_error),
+ IsCertErrorFatal(cert_error),
strict_enforcement,
callback)));
contentsDelegate->allowCertificateError(errorController);
diff --git a/src/webenginewidgets/api/qwebenginepage.cpp b/src/webenginewidgets/api/qwebenginepage.cpp
index 35fe542e..d7f65c23 100644
--- a/src/webenginewidgets/api/qwebenginepage.cpp
+++ b/src/webenginewidgets/api/qwebenginepage.cpp
@@ -1787,7 +1787,7 @@ void QWebEnginePagePrivate::allowCertificateError(const QSharedPointer<Certifica
Q_Q(QWebEnginePage);
bool accepted = false;
- QWebEngineCertificateError error(controller->error(), controller->url(), controller->overridable() && !controller->strictEnforcement(), controller->errorString());
+ QWebEngineCertificateError error(controller->error(), controller->url(), controller->overridable(), controller->errorString());
accepted = q->certificateError(error);
if (error.isOverridable())