Hello everyone,
I'm trying to make a quick program to retrieve buttcoin price from btc-e in json format, but I'm not actually receiving anything in the QNetworkReply. I think it's due to SSL (Heartbleed) updates that I don't have, but I'm not quite sure. Here's my code:
#include <QtGui/QMainWindow>
#include <QUrl>
#include <QNetworkAccessManager>
#include <QNetworkRequest>
#include <QNetworkReply>
#include <QSslConfiguration>
#include <QNetworkProxy>
//in constructor
QNetworkAccessManager *nwam = new QNetworkAccessManager();
connect(nwam,SIGNAL(finished(QNetworkReply*)),this,SLOT(rfinish(QNetworkReply*)));
void mainWindow::pbSendClicked(){
QUrl url
("https://btc-e.com/api/3/ticker/btc_usd");
QNetworkRequest request;
request.setUrl(url);
QSslConfiguration config = QSslConfiguration::defaultConfiguration();
config.setProtocol(QSsl::TlsV1);
request.setSslConfiguration(config);
nwam->get(request);
}
void hcode::rfinish(QNetworkReply *r){
//debug
cout << "reply: " << herp.toStdString().c_str() << endl;
}
#include <QtGui/QMainWindow>
#include <QUrl>
#include <QNetworkAccessManager>
#include <QNetworkRequest>
#include <QNetworkReply>
#include <QSslConfiguration>
#include <QNetworkProxy>
//in constructor
QNetworkAccessManager *nwam = new QNetworkAccessManager();
connect(nwam,SIGNAL(finished(QNetworkReply*)),this,SLOT(rfinish(QNetworkReply*)));
void mainWindow::pbSendClicked(){
QUrl url("https://btc-e.com/api/3/ticker/btc_usd");
QNetworkRequest request;
request.setUrl(url);
QSslConfiguration config = QSslConfiguration::defaultConfiguration();
config.setProtocol(QSsl::TlsV1);
request.setSslConfiguration(config);
nwam->get(request);
}
void hcode::rfinish(QNetworkReply *r){
QString herp=QString::fromUtf8(r->readAll());
//debug
cout << "reply: " << herp.toStdString().c_str() << endl;
}
To copy to clipboard, switch view to plain text mode
The herp string is empty when I send the query. I have libeay32.dll and ssleay32.dll in the same folder as the exe. What's missing?
Thanks in advance.
Mr_Cloud
Bookmarks