Skip to content

Commit d5d0cd8

Browse files
author
Kirill Burtsev
committed
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 <[email protected]>
1 parent 83c5182 commit d5d0cd8

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/webengine/api/qquickwebengineview.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ void QQuickWebEngineViewPrivate::allowCertificateError(const QSharedPointer<Cert
294294
// mark the object for gc by creating temporary jsvalue
295295
qmlEngine(q)->newQObject(quickController);
296296
Q_EMIT q->certificateError(quickController);
297-
if (!quickController->deferred() && !quickController->answered())
297+
if (!quickController->overridable() || (!quickController->deferred() && !quickController->answered()))
298298
quickController->rejectCertificate();
299299
else
300300
m_certificateErrorControllers.append(errorController);

src/webenginewidgets/api/qwebenginepage.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1789,9 +1789,7 @@ void QWebEnginePagePrivate::allowCertificateError(const QSharedPointer<Certifica
17891789

17901790
QWebEngineCertificateError error(controller->error(), controller->url(), controller->overridable(), controller->errorString());
17911791
accepted = q->certificateError(error);
1792-
1793-
if (error.isOverridable())
1794-
controller->accept(accepted);
1792+
controller->accept(error.isOverridable() && accepted);
17951793
}
17961794

17971795
void QWebEnginePagePrivate::selectClientCert(const QSharedPointer<ClientCertSelectController> &controller)

0 commit comments

Comments
 (0)