store headers only once, refs #7
This commit is contained in:
@@ -1,48 +1,48 @@
|
||||
#include <QApplication>
|
||||
#include <QtNetwork>
|
||||
#include <QtWebKit>
|
||||
#include <QList>
|
||||
#include <QFile>
|
||||
#include <iostream>
|
||||
#include "smartcardauth.h"
|
||||
|
||||
SmartCardAuth g_scard_auth;
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
|
||||
SmartCardAuth::initialize();
|
||||
|
||||
QApplication app(argc, argv);
|
||||
|
||||
QSslConfiguration sslConf(QSslConfiguration::defaultConfiguration());
|
||||
|
||||
// Works even without specifying the root certificate, we just need to add the intermediates,
|
||||
// and that's done in SmartCardAuth.cpp
|
||||
#if 0
|
||||
QFile caCertsFile("D:\\QtSmartCardAuth_TMI\\QtSslTest\\swsign_root.pem");
|
||||
caCertsFile.open(QIODevice::ReadOnly);
|
||||
QList<QSslCertificate> chain( QSslCertificate::fromDevice(&caCertsFile) );
|
||||
|
||||
sslConf.setCaCertificates(chain);
|
||||
#endif
|
||||
|
||||
sslConf.setPeerVerifyMode(QSslSocket::QueryPeer);
|
||||
sslConf.setOpenSslHook(&g_scard_auth);
|
||||
QSslConfiguration::setDefaultConfiguration(sslConf);
|
||||
|
||||
// TODO - IMPORTANT: Error reporting!
|
||||
// If there is ANY failure (no network, no host resolution, no SSL connection, timeout) we just see a
|
||||
// blank page!
|
||||
QWebView web;
|
||||
|
||||
// Works - NEEDS AN INTERMEDIATE CERTIFICATE, either loaded from card or from file, see SmartCardAuth
|
||||
web.load(QUrl("https://dev.swisssign.com/test/"));
|
||||
|
||||
// web.load(QUrl("https://e2k7.demo8.cryptovision.com/ssl/"));
|
||||
web.show();
|
||||
|
||||
int rv=app.exec();
|
||||
SmartCardAuth::deinitialize();
|
||||
return rv;
|
||||
}
|
||||
#include <QApplication>
|
||||
#include <QtNetwork>
|
||||
#include <QtWebKit>
|
||||
#include <QList>
|
||||
#include <QFile>
|
||||
#include <iostream>
|
||||
#include "smartcardauth.h"
|
||||
|
||||
SmartCardAuth g_scard_auth;
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
|
||||
SmartCardAuth::initialize();
|
||||
|
||||
QApplication app(argc, argv);
|
||||
|
||||
QSslConfiguration sslConf(QSslConfiguration::defaultConfiguration());
|
||||
|
||||
// Works even without specifying the root certificate, we just need to add the intermediates,
|
||||
// and that's done in SmartCardAuth.cpp
|
||||
#if 0
|
||||
QFile caCertsFile("D:\\QtSmartCardAuth_TMI\\QtSslTest\\swsign_root.pem");
|
||||
caCertsFile.open(QIODevice::ReadOnly);
|
||||
QList<QSslCertificate> chain( QSslCertificate::fromDevice(&caCertsFile) );
|
||||
|
||||
sslConf.setCaCertificates(chain);
|
||||
#endif
|
||||
|
||||
sslConf.setPeerVerifyMode(QSslSocket::QueryPeer);
|
||||
sslConf.setOpenSslHook(&g_scard_auth);
|
||||
QSslConfiguration::setDefaultConfiguration(sslConf);
|
||||
|
||||
// TODO - IMPORTANT: Error reporting!
|
||||
// If there is ANY failure (no network, no host resolution, no SSL connection, timeout) we just see a
|
||||
// blank page!
|
||||
QWebView web;
|
||||
|
||||
// Works - NEEDS AN INTERMEDIATE CERTIFICATE, either loaded from card or from file, see SmartCardAuth
|
||||
web.load(QUrl("https://dev.swisssign.com/test/"));
|
||||
|
||||
// web.load(QUrl("https://e2k7.demo8.cryptovision.com/ssl/"));
|
||||
web.show();
|
||||
|
||||
int rv=app.exec();
|
||||
SmartCardAuth::deinitialize();
|
||||
return rv;
|
||||
}
|
||||
|
Reference in New Issue
Block a user