Display more information about the certificate error
Previously when a certificate error occurred when using WebEnginePart, the user was only shown a short description of the error. This is in contrast to what happens with KHTML or KWebKitPart. These changes try to improve the level of information provided in this regard by WebEnginePart. Unfortunately, QtWebEngine doesn't give the same information details about certificates as KIO does. In particular:
- information about certificates is only availlable in case of errors
- even in case of errors, the only information availlable regards the certificate chain and not the connection.
There are two things worth noting:
- I used the class
KIO::KSslCertificateBox
to display the certificate information. As I couldn't find this class onapi.kde.org
, I'm not sure if it's an internal KIO class or not - when the current part is not a
WebEnginePart
and a web page is opened, for example by clicking a link in a PDF file, the page is first loaded by KIO, which will ask the user what to do in case of a certificate error, then byWebEnginePart
, which will, in turn, inform the user about the error. To avoid this situation, a property is set on theWebEnginePart
byKonqView::openUrl
in this situation. This property is read byWebEnginePart::load
and, if present, tellsWebEnginePage
to always ignore the error.