We need a way of handling insecure/invalid certificates instead of just dropping the connection.
Created attachment 123462 [details] Patch
Comment on attachment 123462 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=123462&action=review > Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp:500 > +bool QQuickWebViewPrivate::handleCertificateVerificationRequest(const QString& hostname) > +{ > + if (!certificateVerificationDialog) > + return false; > + > + Q_Q(QQuickWebView); > + QtDialogRunner dialogRunner; > + if (!dialogRunner.initForCertificateVerification(certificateVerificationDialog, q, hostname)) > + return false; > + > + setViewInAttachedProperties(dialogRunner.dialog()); > + > + disableMouseEvents(); > + dialogRunner.exec(); > + enableMouseEvents(); > + > + return dialogRunner.wasAccepted(); > +} Just a thought, but is this boiler-plate code something that can be centralized, either via a template or perhaps a macro?
Comment on attachment 123462 [details] Patch Clearing flags on attachment: 123462 Committed r105670: <http://trac.webkit.org/changeset/105670>
All reviewed patches have been landed. Closing bug.
HI Alex, Is there a test(.qml) implemented some where that tests this API?( I was expecting it to be in WebKit2/UIProcess/API/qt/tests/qmltests/WebView/tst_javaScriptDialogs.qml, but its not there ). I am trying to use this API, in a .qml file but i don't see my qml changes on browser. I have built Qt5 webkit2 almost a week ago and i think that version is good enough to use your changes. I am just trying to use this API in following ways in a main.qml as import QtQuick 2.0 import QtWebKit 3.0 import QtWebKit.experimental 1.0 Rectangle { id: root . . . . . . experimental.certificateVerificationDialog: CertificateVerificationDialog{ } . . . . . } and my CertificateVerificationDialog.qml is as follows import QtQuick 2.0 Rectangle { id: cvdPage width:600; height:400 color: "Black" Text { id: message x: 10; y: 10 wrapMode : Text.WordWrap text: "Certificate Verification Failed, what do u want to do?" color: "white" font.bold: true; font.pixelSize: 18; } Rectangle { id: backButton width: cvdPage.width/3 ; height: cvdPage.height/5 color: "Green" anchors.top: message.bottom x: 10; Text { id: backButtonText anchors.verticalCenter : parent.verticalCenter anchors.horizontalCenter : parent.horizontalCenter text: "Back to Safety"; color: "white" font.bold: true; font.pixelSize: 16; } MouseArea { id: backButtonMouseArea anchors.fill: parent onClicked: console.log(backButtonText.text + " clicked" ) } } Rectangle { id: proceedButton width: cvdPage.width/3 ; height: cvdPage.height/5 color: "Red" anchors.top: message.bottom anchors.left: backButton.right anchors.leftMargin: 15 Text { id: proceedButtonText anchors.verticalCenter : parent.verticalCenter anchors.horizontalCenter : parent.horizontalCenter text: "Proceed anyway"; color: "white" font.bold: true; font.pixelSize: 16; } MouseArea { id: backButtonMouseArea anchors.fill: parent onClicked: console.log(backButtonText.text + " clicked" ) } } Rectangle { id: proceedButton width: cvdPage.width/3 ; height: cvdPage.height/5 color: "Red" anchors.top: message.bottom anchors.left: backButton.right anchors.leftMargin: 15 Text { id: proceedButtonText anchors.verticalCenter : parent.verticalCenter anchors.horizontalCenter : parent.horizontalCenter text: "Proceed anyway"; color: "white" font.bold: true; font.pixelSize: 16; } MouseArea { id: proceedButtonMouseArea anchors.fill: parent onClicked: console.log(proceedButtonText.text + " clicked" ) } } } P.S: Please neglect the onClicked handlers, i just have to implement webView.goBack and webView.load functions once i see basic connection up and running. Please let me know if i am missing something in order to make use of certificateVerificationDialog API that you have implemented for QML.
Hi Alex, Can you please confirm if this API is working on Qt5 WebKit2?.