diff options
author | Paulo Pinheiro <paulovap.os@gmail.com> | 2014-10-10 12:18:05 -0300 |
---|---|---|
committer | Michael BrĂ¼ning <michael.bruning@theqtcompany.com> | 2015-02-02 11:00:23 +0000 |
commit | 6d896290a020babe5fbaf6c444485df8b1d5d353 (patch) | |
tree | 87aa1de0b21668446f762bd83897b71f2e902cbd /examples/webengine | |
parent | fcc9a1d4283079cfa4f36c48b832461d59e8a627 (diff) |
Add Qt WebEngine Quick API for allowing certificate errors
This adds API for overriding some certificate errors. Once overridden
any identical error for the same hostname and certificate will use
the same override.
Change-Id: Idf9e968edca18751cbdab744880480750d0c1bd4
Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
Diffstat (limited to 'examples/webengine')
-rw-r--r-- | examples/webengine/quicknanobrowser/BrowserWindow.qml | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/examples/webengine/quicknanobrowser/BrowserWindow.qml b/examples/webengine/quicknanobrowser/BrowserWindow.qml index 8d9980746..0b8772791 100644 --- a/examples/webengine/quicknanobrowser/BrowserWindow.qml +++ b/examples/webengine/quicknanobrowser/BrowserWindow.qml @@ -45,6 +45,7 @@ import QtQuick.Controls.Styles 1.0 import QtQuick.Layouts 1.0 import QtQuick.Window 2.1 import QtQuick.Controls.Private 1.0 +import QtQuick.Dialogs 1.2 ApplicationWindow { id: browserWindow @@ -198,6 +199,14 @@ ApplicationWindow { statusText.text = hoveredUrl } } + + onCertificateError: { + sslDialog.certError = error + sslDialog.text = "Certificate Error: " + error.description + sslDialog.visible = true + error.defer() + } + onNewViewRequested: { if (!request.userInitiated) print("Warning: Blocked a popup window.") @@ -215,7 +224,18 @@ ApplicationWindow { } } } + MessageDialog { + id: sslDialog + property var certError + + standardButtons: StandardButton.Cancel | StandardButton.Ok + visible: false + title: "Do you want to accept this certificate?" + + onAccepted: certError.ignoreCertificateError() + onRejected: certError.rejectCertificate() + } Rectangle { id: statusBubble color: "oldlace" |