From d1711fffc795d925d89980f56cd02b767e871c59 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Mon, 25 Jul 2011 19:01:24 +0200 Subject: Last SSL fixes - strings - bool WebPage::hasSslValid() const - check all the certificate chain --- src/webpage.cpp | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'src/webpage.cpp') diff --git a/src/webpage.cpp b/src/webpage.cpp index 3f4b4e1f..3986fafb 100644 --- a/src/webpage.cpp +++ b/src/webpage.cpp @@ -545,7 +545,7 @@ void WebPage::manageNetworkErrors(QNetworkReply *reply) QWebFrame* frame = qobject_cast(reply->request().originatingObject()); const bool isMainFrameRequest = (frame == mainFrame()); - const bool isLoadingUrlReply = (_loadingUrl == reply->url()); + const bool isLoadingUrlReply = (mainFrame()->url() == reply->url()); if(isMainFrameRequest && _sslInfo.isValid() @@ -753,17 +753,24 @@ void WebPage::copyToTempFileResult(KJob* job) } -bool WebPage::hasSslValid() +bool WebPage::hasSslValid() const { QList certList = _sslInfo.certificateChain(); if (certList.isEmpty()) return false; - QSslCertificate firstCert = certList.at(0); - if (!firstCert.isValid()) - return false; + Q_FOREACH(const QSslCertificate &cert, certList) + { + if (!cert.isValid()) + return false; + } - QStringList firstCertErrorsList = SslInfoDialog::errorsFromString(_sslInfo.certificateErrors()).at(0); - return firstCertErrorsList.isEmpty(); + QList errorList = SslInfoDialog::errorsFromString(_sslInfo.certificateErrors()); + Q_FOREACH(const QStringList & list, errorList) + { + if (!list.isEmpty()) + return false; + } + return true; } -- cgit v1.2.1