2009-11-22 Jakub Wieczorek <faw217@gmail.com>
authoreric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 22 Nov 2009 22:29:10 +0000 (22:29 +0000)
committereric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 22 Nov 2009 22:29:10 +0000 (22:29 +0000)
        Reviewed by Adam Barth.

        [Qt] DumpRenderTree should explicitly ignore any SSL certificate errors
        for localhost and 127.0.0.1.
        https://bugs.webkit.org/show_bug.cgi?id=31783

        Unskip the http/tests/ssl/verify-ssl-enabled.php test, which is passing now.

        * platform/qt/Skipped:
2009-11-22  Jakub Wieczorek  <faw217@gmail.com>

        Reviewed by Adam Barth.

        [Qt] DumpRenderTree should explicitly ignore any SSL certificate errors
        for localhost and 127.0.0.1.
        https://bugs.webkit.org/show_bug.cgi?id=31783

        Unskip the http/tests/ssl/verify-ssl-enabled.php test, which is passing now.

        * DumpRenderTree/qt/DumpRenderTree.cpp:
        (WebCore::NetworkAccessManager::NetworkAccessManager):
        (WebCore::NetworkAccessManager::sslErrorsEncountered):
        (WebCore::WebPage::WebPage):
        * DumpRenderTree/qt/DumpRenderTree.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@51298 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/platform/qt/Skipped
WebKitTools/ChangeLog
WebKitTools/DumpRenderTree/qt/DumpRenderTree.cpp
WebKitTools/DumpRenderTree/qt/DumpRenderTree.h

index f9be35326bbc9595ed3746f8888fbb1e3b00ce72..21eaced36f12c7f9433d4177bb1234d9dc2cad45 100644 (file)
@@ -1,3 +1,15 @@
+2009-11-22  Jakub Wieczorek  <faw217@gmail.com>
+
+        Reviewed by Adam Barth.
+
+        [Qt] DumpRenderTree should explicitly ignore any SSL certificate errors
+        for localhost and 127.0.0.1.
+        https://bugs.webkit.org/show_bug.cgi?id=31783
+
+        Unskip the http/tests/ssl/verify-ssl-enabled.php test, which is passing now.
+
+        * platform/qt/Skipped:
+
 2009-11-22  Chris Evans  <cevans@chromium.org>
 
         Reviewed by Adam Barth.
index 6ce758f413e7548856617a096eecea051f8d5593..58fff99695fa4a5a3597b2db207c5c4e0c8248a2 100644 (file)
@@ -37,13 +37,16 @@ http/tests/incremental
 http/tests/media
 http/tests/navigation
 http/tests/plugins
-http/tests/ssl
 http/tests/webarchive
 http/tests/wml
 
 # Failing URL test
 http/tests/uri/escaped-entity.html
 
+# Failing HTTP SSL tests
+http/tests/ssl/referer-301.html
+http/tests/ssl/referer-303.html
+
 # Failing HTTP Loading tests
 http/tests/loading/bad-server-subframe.html
 http/tests/loading/bad-scheme-subframe.html
index 1524a3ea883fabd24b9f5c030a7290511c8b38c7..6bd89199db62266737b4b3b5ccecfb2a9218043b 100644 (file)
@@ -1,3 +1,19 @@
+2009-11-22  Jakub Wieczorek  <faw217@gmail.com>
+
+        Reviewed by Adam Barth.
+
+        [Qt] DumpRenderTree should explicitly ignore any SSL certificate errors
+        for localhost and 127.0.0.1.
+        https://bugs.webkit.org/show_bug.cgi?id=31783
+
+        Unskip the http/tests/ssl/verify-ssl-enabled.php test, which is passing now.
+
+        * DumpRenderTree/qt/DumpRenderTree.cpp:
+        (WebCore::NetworkAccessManager::NetworkAccessManager):
+        (WebCore::NetworkAccessManager::sslErrorsEncountered):
+        (WebCore::WebPage::WebPage):
+        * DumpRenderTree/qt/DumpRenderTree.h:
+
 2009-11-22  Chris Evans  <cevans@chromium.org>
 
         Reviewed by Adam Barth.
index ee15c705e24988de9faacacc440a32e204d6696d..a4ef6bd9626d2e69773e0d90c7042f29aed12fa3 100644 (file)
@@ -49,6 +49,8 @@
 #include <QFileInfo>
 #include <QFocusEvent>
 #include <QFontDatabase>
+#include <QNetworkAccessManager>
+#include <QNetworkReply>
 #include <QNetworkRequest>
 #include <QUndoStack>
 
@@ -79,6 +81,35 @@ namespace WebCore {
 const unsigned int maxViewWidth = 800;
 const unsigned int maxViewHeight = 600;
 
+NetworkAccessManager::NetworkAccessManager(QObject* parent)
+    : QNetworkAccessManager(parent)
+{
+#ifndef QT_NO_SSL
+    connect(this, SIGNAL(sslErrors(QNetworkReply*, const QList<QSslError>&)),
+            this, SLOT(sslErrorsEncountered(QNetworkReply*, const QList<QSslError>&)));
+#endif
+}
+
+#ifndef QT_NO_SSL
+void NetworkAccessManager::sslErrorsEncountered(QNetworkReply* reply, const QList<QSslError>& errors)
+{
+    if (reply->url().host() == "127.0.0.1" || reply->url().host() == "localhost") {
+        bool ignore = true;
+
+        // Accept any HTTPS certificate.
+        foreach (const QSslError& error, errors) {
+            if (error.error() < QSslError::UnableToGetIssuerCertificate || error.error() > QSslError::HostNameMismatch) {
+                ignore = false;
+                break;
+            }
+        }
+
+        if (ignore)
+            reply->ignoreSslErrors();
+    }
+}
+#endif
+
 WebPage::WebPage(QWidget *parent, DumpRenderTree *drt)
     : QWebPage(parent)
     , m_drt(drt)
@@ -102,6 +133,7 @@ WebPage::WebPage(QWidget *parent, DumpRenderTree *drt)
     connect(this, SIGNAL(geometryChangeRequested(const QRect &)),
             this, SLOT(setViewGeometry(const QRect & )));
 
+    setNetworkAccessManager(new NetworkAccessManager(this));
     setPluginFactory(new TestPlugin(this));
 }
 
index 8812901ca780ae396f59398a99971860a8c20611..f19a67a07ec8d44535d09fc971146b03fc6c9cab 100644 (file)
 #define DUMPRENDERTREE_H
 
 #include <QList>
+#include <QNetworkAccessManager>
 #include <QObject>
 #include <QTextStream>
 #include <QSocketNotifier>
 
+#ifndef QT_NO_SSL
+#include <QSslError>
+#endif
+
 #include <qwebpage.h>
 
 QT_BEGIN_NAMESPACE
@@ -121,6 +126,17 @@ private:
     bool m_enableTextOutput;
 };
 
+class NetworkAccessManager : public QNetworkAccessManager {
+    Q_OBJECT
+public:
+    NetworkAccessManager(QObject* parent);
+
+private slots:
+#ifndef QT_NO_SSL
+    void sslErrorsEncountered(QNetworkReply*, const QList<QSslError>&);
+#endif
+};
+
 class WebPage : public QWebPage {
     Q_OBJECT
 public: