summaryrefslogtreecommitdiffstats
path: root/src/fbgui
diff options
context:
space:
mode:
authorJonathan Bauer2012-06-22 15:33:29 +0200
committerJonathan Bauer2012-06-22 15:33:29 +0200
commit4658fb5f8450f0058ba568b5952d53d58ffbce8a (patch)
tree280ad6fe3bf325027ecd6798c521317cfbcefd63 /src/fbgui
parentrenamed build-pkg.sh to pkg.sh (diff)
downloadfbgui-4658fb5f8450f0058ba568b5952d53d58ffbce8a.tar.gz
fbgui-4658fb5f8450f0058ba568b5952d53d58ffbce8a.tar.xz
fbgui-4658fb5f8450f0058ba568b5952d53d58ffbce8a.zip
workaround to load ssl sites (todo proper error handling)
Diffstat (limited to 'src/fbgui')
-rw-r--r--src/fbgui/fbgui.cpp15
-rw-r--r--src/fbgui/fbgui.h1
2 files changed, 14 insertions, 2 deletions
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();