Ask the user what to do in case of a SSL certificate error

Authored by stefanocrocco on Oct 21 2018, 2:51 PM.

Description

Ask the user what to do in case of a SSL certificate error

Summary:
When a certificate error happens, the user is asked whether to ignore
the error or not.

Things become more complicated if the page is loaded by
WebEnginePart::load. In this case, SSL errors will have already been
detected by the KParts framework, so asking the user again would be
meaningless. To avoid this, before calling WebEngineView::load,
WebEnginePart::load stores the URL in an instance variable of
WebEnginePage: WebEnginePage::certificateError checks whether this
variable is the same as the URL which produced the error and, in this
case, always returns true.

Unfortunately, it's impossible to integrate all of this with the KDE
certificates management system, as QWebEngine doesn't provide any information
about them except an error code and description.

Test Plan:
find a page with an invalid SSL certificate, enter it in the address
bar then check that one (and only one) dialog is shown and that answering to
ignore the error makes the page load.

Attempt to load the web page from a link and check that the behaviour is the
same.

Reviewers: dfaure

Reviewed By: dfaure

Differential Revision: https://phabricator.kde.org/D16355