-
-
Save matiasinsaurralde/4f42e3f8bbab3c90d40d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <QDebug> | |
#include <QWidget> | |
#include <QNetworkReply> | |
#include <QSslConfiguration> | |
App::App(QWidget *parent) : | |
QWidget(parent), | |
ui(new Ui::App) | |
{ | |
ui->setupUi(this); | |
QSslConfiguration sslCfg = QSslConfiguration::defaultConfiguration(); | |
QList<QSslCertificate> ca_list = sslCfg.caCertificates(); | |
QList<QSslCertificate> ca_new = QSslCertificate::fromData("CaCertificates"); | |
ca_list += ca_new; | |
sslCfg.setCaCertificates(ca_list); | |
sslCfg.setProtocol(QSsl::AnyProtocol); | |
QSslConfiguration::setDefaultConfiguration(sslCfg); | |
connect(ui->webView->page()->networkAccessManager(), | |
SIGNAL(sslErrors(QNetworkReply*, const QList<QSslError> & )), | |
this, | |
SLOT(sslErrorHandler(QNetworkReply*, const QList<QSslError> & ))); | |
} | |
void App::sslErrorHandler(QNetworkReply* qnr, const QList<QSslError> & errlist) | |
{ | |
#if DEBUG_ENABLED | |
qDebug() << "---frmBuyIt::sslErrorHandler: "; | |
// show list of all ssl errors | |
foreach (QSslError err, errlist) | |
qDebug() << "ssl error: " << err; | |
#endif | |
qnr->ignoreSslErrors(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment