Skip to content
Permalink
Browse files
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  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:

Canonical link: https://commits.webkit.org/42727@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@51298 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
eseidel committed Nov 22, 2009
1 parent a1a8e6f commit 7248ee7366ec3b8b4d627143c38bba6edb964e1a
Showing 5 changed files with 80 additions and 1 deletion.
@@ -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.
@@ -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
@@ -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.
@@ -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));
}

@@ -31,10 +31,15 @@
#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 @@ public Q_SLOTS:
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:

0 comments on commit 7248ee7

Please sign in to comment.