diff options
author | Jonathan Bauer | 2012-06-22 15:33:29 +0200 |
---|---|---|
committer | Jonathan Bauer | 2012-06-22 15:33:29 +0200 |
commit | 4658fb5f8450f0058ba568b5952d53d58ffbce8a (patch) | |
tree | 280ad6fe3bf325027ecd6798c521317cfbcefd63 | |
parent | renamed build-pkg.sh to pkg.sh (diff) | |
download | fbgui-4658fb5f8450f0058ba568b5952d53d58ffbce8a.tar.gz fbgui-4658fb5f8450f0058ba568b5952d53d58ffbce8a.tar.xz fbgui-4658fb5f8450f0058ba568b5952d53d58ffbce8a.zip |
workaround to load ssl sites (todo proper error handling)
-rwxr-xr-x | build-pkg.sh | 37 | ||||
-rw-r--r-- | src/fbgui/fbgui.cpp | 15 | ||||
-rw-r--r-- | src/fbgui/fbgui.h | 1 |
3 files changed, 14 insertions, 39 deletions
diff --git a/build-pkg.sh b/build-pkg.sh deleted file mode 100755 index 92c8e42..0000000 --- a/build-pkg.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash -# this script requires fbgui to be compiled. -# To compile use: -# ./build.sh (TODO) - -QT_VERSION=QtEmbedded-4.7.2 - -[ -f fbgui.tgz ] && rm fbgui.tgz - -mkdir -p pkg - -cd pkg - -mkdir -p bin -cp ../build/src/fbgui/fbgui bin -strip bin/fbgui - -mkdir -p usr/local/Trolltech/${QT_VERSION}/lib -cp -r /usr/local/Trolltech/${QT_VERSION}/lib/fonts \ - usr/local/Trolltech/${QT_VERSION}/lib/ - -for SHARED_LIBRARY in `ldd bin/fbgui | awk '{print $3}' |grep ^/` -do -#echo "$SHARED_LIBRARY" -DIR=`dirname $SHARED_LIBRARY | cut -c2-` -[ ! -d $DIR ] && mkdir -p $DIR -[ ! -s "`echo $SHARED_LIBRARY | cut -c2-`" ] && \ -cp $SHARED_LIBRARY `echo $SHARED_LIBRARY | cut -c2-` -done - -mkdir -p etc -cp ../fbgui.conf etc - -tar czf ../fbgui.tgz usr etc lib bin - -cd - &> /dev/null -rm -rf pkg diff --git a/src/fbgui/fbgui.cpp b/src/fbgui/fbgui.cpp index 2881a30..0fd61be 100644 --- a/src/fbgui/fbgui.cpp +++ b/src/fbgui/fbgui.cpp @@ -126,6 +126,9 @@ void fbgui::loadURL() { QByteArray postData = generatePOSTData(); // Generate a Network Request Object QNetworkRequest req(baseURL); + QObject::connect(_webView->page()->networkAccessManager(), SIGNAL(sslErrors(QNetworkReply*, const QList<QSslError> & )), + this, SLOT(sslErrorHandler(QNetworkReply*, QList<QSslError> ))); + // show cursor again since user is about to interact. req.setHeader(QNetworkRequest::ContentTypeHeader, @@ -135,7 +138,15 @@ void fbgui::loadURL() { } // TODO: error page if no host. } - +void fbgui::sslErrorHandler(QNetworkReply* rep, QList<QSslError> errList) { + LOG4CXX_DEBUG(coreLogger, "Received SSL errors:"); + rep->ignoreSslErrors(errList); + QList<QSslError>::iterator n; + for (n = errList.begin(); n != errList.end(); ++n) { + LOG4CXX_DEBUG(coreLogger, "Error :" << n->errorString()); + } + LOG4CXX_DEBUG(coreLogger, "End SSL errors:"); +} void fbgui::loadURLDone(bool success) { // done contains the success of the loading: false / true if (!success) { @@ -275,7 +286,7 @@ QByteArray fbgui::generatePOSTData() { // everything ok, read data serial = file.readAll(); file.close(); - serial.chop(1); // chop EOF + //serial.chop(1); // chop EOF LOG4CXX_DEBUG(coreLogger, "[post] Serial number is: " << serial); if (gInterfaceName.isEmpty()) diff --git a/src/fbgui/fbgui.h b/src/fbgui/fbgui.h index 3eb4bcd..07b69f4 100644 --- a/src/fbgui/fbgui.h +++ b/src/fbgui/fbgui.h @@ -48,6 +48,7 @@ private: private slots: void loadURLDone(bool success); + void sslErrorHandler(QNetworkReply* rep, QList<QSslError> errList); void clearAllCookies(); void printCookies(); void printHistory(); |