summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKirill Burtsev <kirill.burtsev@qt.io>2019-08-14 18:45:36 +0200
committerKirill Burtsev <kirill.burtsev@qt.io>2019-08-29 16:30:13 +0000
commitd5d0cd81cc770d696b19305717cc827ec1a89bd4 (patch)
tree86d1fc9f25a1596bd4004c33128f30b73c4c1ad4
parent83c5182c998b74858c5c28fcf2feb1d4e07754bb (diff)
Reject certificate error for non-overridable errors
On certificate validation error page load is just halted meaning that no progress or load result are reported and no default error page for certificate errors is shown. Even though documentation states that 'By default, an invalid certificate will be automatically rejected' and that aligns with default implementation of certificateError method within Page and non-deferred errors in quick View, page or view silently stays in an intermediate state for non-overridable errors. Fix this inconsistent behavior by automatically rejecting certificate for every invalid case (non-overridable error, not deferred or not implemented overridable method). Change-Id: Id1cee2ee5cc45bdcb5f262a6c99c84274e6ca374 Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
-rw-r--r--src/webengine/api/qquickwebengineview.cpp2
-rw-r--r--src/webenginewidgets/api/qwebenginepage.cpp4
2 files changed, 2 insertions, 4 deletions
diff --git a/src/webengine/api/qquickwebengineview.cpp b/src/webengine/api/qquickwebengineview.cpp
index c8ba64f4..8097689a 100644
--- a/src/webengine/api/qquickwebengineview.cpp
+++ b/src/webengine/api/qquickwebengineview.cpp
@@ -294,7 +294,7 @@ void QQuickWebEngineViewPrivate::allowCertificateError(const QSharedPointer<Cert
// mark the object for gc by creating temporary jsvalue
qmlEngine(q)->newQObject(quickController);
Q_EMIT q->certificateError(quickController);
- if (!quickController->deferred() && !quickController->answered())
+ if (!quickController->overridable() || (!quickController->deferred() && !quickController->answered()))
quickController->rejectCertificate();
else
m_certificateErrorControllers.append(errorController);
diff --git a/src/webenginewidgets/api/qwebenginepage.cpp b/src/webenginewidgets/api/qwebenginepage.cpp
index d7f65c23..aeed6ce8 100644
--- a/src/webenginewidgets/api/qwebenginepage.cpp
+++ b/src/webenginewidgets/api/qwebenginepage.cpp
@@ -1789,9 +1789,7 @@ void QWebEnginePagePrivate::allowCertificateError(const QSharedPointer<Certifica
QWebEngineCertificateError error(controller->error(), controller->url(), controller->overridable(), controller->errorString());
accepted = q->certificateError(error);
-
- if (error.isOverridable())
- controller->accept(accepted);
+ controller->accept(error.isOverridable() && accepted);
}
void QWebEnginePagePrivate::selectClientCert(const QSharedPointer<ClientCertSelectController> &controller)