diff options
author | Kaloyan Chehlarski <kaloyan.chehlarski@qt.io> | 2024-02-28 11:18:23 +0100 |
---|---|---|
committer | Kaloyan Chehlarski <kaloyan.chehlarski@qt.io> | 2024-05-17 11:39:07 +0200 |
commit | c18dfe70f3f7adc7c88988d9a06a6a65fd509c19 (patch) | |
tree | 68301af74d18c796419f6e4d91d7e59063184809 /examples/webenginequick/quicknanobrowser/doc | |
parent | cca9b5b8fef8b11e631a1b46fa5c6f0a262b0e5c (diff) |
Allow checking whether certificate error comes from a page resource
Currently, all certificate errors are handled the same way, regardless
of whether they come from the main frame or from an outside resource.
On the user side, this means that all certificate errors for resources
trigger a pop-up claiming the page is unsafe. Other browsers do not
do this, and instead automatically reject bad certificates for
resources.
This change extends the QWebEngineCertificateError API to allow
querying for whether the error comes from the main frame, or from
a resource. This information is already supplied by Chromium, but we
previously just ignored it. With this, application developers may now
choose to auto-reject resource errors just as Chrome does.
The simple and quick nano browser examples have been updated to
reject certificate errors coming from a page resource.
Task-number: QTBUG-92009
Change-Id: Id38b21f569318d7a83332d4ba69cb27d14b53430
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'examples/webenginequick/quicknanobrowser/doc')
-rw-r--r-- | examples/webenginequick/quicknanobrowser/doc/src/quicknanobrowser.qdoc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/examples/webenginequick/quicknanobrowser/doc/src/quicknanobrowser.qdoc b/examples/webenginequick/quicknanobrowser/doc/src/quicknanobrowser.qdoc index 1dc209c2e..1e00402ff 100644 --- a/examples/webenginequick/quicknanobrowser/doc/src/quicknanobrowser.qdoc +++ b/examples/webenginequick/quicknanobrowser/doc/src/quicknanobrowser.qdoc @@ -75,13 +75,16 @@ \section1 Handling Certificate Errors - If the certificate of the site being loaded triggers a certificate error, we call the - \l{WebEngineCertificateError::}{defer()} QML method to pause the URL request and wait for user - input: + In case of a certificate error, we check whether it came from the main frame, or from a + resource inside the page. Resource errors automatically trigger a certificate rejection, + since a user won't have enough context to make a decision. + For all other cases, we call the \l{WebEngineCertificateError::}{defer()} QML method to pause + the URL request and wait for user input: \quotefromfile webenginequick/quicknanobrowser/BrowserWindow.qml \skipto onCertificateError \printuntil } + \printuntil } We use the Dialog type to prompt users to continue or cancel the loading of the web page. If users select \uicontrol Yes, we call the |