本文整理汇总了C++中QSslConfiguration::caCertificates方法的典型用法代码示例。如果您正苦于以下问题:C++ QSslConfiguration::caCertificates方法的具体用法?C++ QSslConfiguration::caCertificates怎么用?C++ QSslConfiguration::caCertificates使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QSslConfiguration
的用法示例。
在下文中一共展示了QSslConfiguration::caCertificates方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loadSettings
void NetworkAccessManager::loadSettings()
{
QSettings settings;
settings.beginGroup(QLatin1String("proxy"));
QNetworkProxy proxy;
if (settings.value(QLatin1String("enabled"), false).toBool()) {
if (settings.value(QLatin1String("type"), 0).toInt() == 0)
proxy.setType(QNetworkProxy::Socks5Proxy);
else
proxy.setType(QNetworkProxy::HttpProxy);
proxy.setHostName(settings.value(QLatin1String("hostName")).toString());
proxy.setPort(settings.value(QLatin1String("port"), 1080).toInt());
proxy.setUser(settings.value(QLatin1String("userName")).toString());
proxy.setPassword(settings.value(QLatin1String("password")).toString());
}
setProxy(proxy);
settings.endGroup();
#ifndef QT_NO_OPENSSL
QSslConfiguration sslCfg = QSslConfiguration::defaultConfiguration();
QList<QSslCertificate> ca_list = sslCfg.caCertificates();
QList<QSslCertificate> ca_new = QSslCertificate::fromData(settings.value(QLatin1String("CaCertificates")).toByteArray());
ca_list += ca_new;
sslCfg.setCaCertificates(ca_list);
QSslConfiguration::setDefaultConfiguration(sslCfg);
#endif
}
示例2: addHighFidelityRootCAToSSLConfig
void OAuthWebViewHandler::addHighFidelityRootCAToSSLConfig() {
QSslConfiguration sslConfig = QSslConfiguration::defaultConfiguration();
// add the High Fidelity root CA to the list of trusted CA certificates
QByteArray highFidelityCACertificate(HIGH_FIDELITY_CA, sizeof(HIGH_FIDELITY_CA));
sslConfig.setCaCertificates(sslConfig.caCertificates() + QSslCertificate::fromData(highFidelityCACertificate));
// set the modified configuration
QSslConfiguration::setDefaultConfiguration(sslConfig);
}
示例3: cert
LoginTester::LoginTester(QString username,
QString password,
int maxcount,
QWidget *parent) :
QDialog(parent, Qt::FramelessWindowHint),
ui(new Ui::LoginTester)
{
ui->setupUi(this);
ui->button->hide();
// Initialisieren der Variablen
tryCounter = 0;
this->maxTries = maxcount;
this->username = username;
this->password = password;
// Initialisieren des NetworkManagers und der Slots
manager = new QNetworkAccessManager(qApp);
QFile cert(":/certs/l2p");
cert.open(QFile::ReadOnly);
QList<QSslCertificate> newCertificates = QSslCertificate::fromData(cert.readAll(),QSsl::Der);
cert.close();
QSslCertificate newCertificate = newCertificates.first();
QFile cert2(":/certs/utn");
cert2.open(QFile::ReadOnly);
QList<QSslCertificate> newCertificates2 = QSslCertificate::fromData(cert2.readAll(),QSsl::Der);
cert2.close();
QSslCertificate newCertificate2 = newCertificates2.first();
QFile cert3(":/certs/ssl");
cert3.open(QFile::ReadOnly);
QList<QSslCertificate> newCertificates3 = QSslCertificate::fromData(cert3.readAll(),QSsl::Der);
cert3.close();
QSslCertificate newCertificate3 = newCertificates3.first();
QSslConfiguration newSslConfiguration = QSslConfiguration::defaultConfiguration();
newCertificates = newSslConfiguration.caCertificates();
newCertificates.append(newCertificate);
newCertificates.append(newCertificate2);
newCertificates.append(newCertificate3);
newSslConfiguration.setCaCertificates(newCertificates);
QSslConfiguration::setDefaultConfiguration(newSslConfiguration);
QSslConfiguration newSslConfiguration2 = QSslConfiguration::defaultConfiguration();
newCertificates2 = newSslConfiguration2.caCertificates();
foreach (QSslCertificate c, newCertificates2)
{
QStringList list = QStringList(c.subjectInfo(QSslCertificate::CommonName));
for(QStringList::iterator i = list.begin(); i != list.end(); i++){
qDebug(i->toLatin1());
}
}
示例4: sslErrors
void NetworkAccessManager::sslErrors(QNetworkReply *reply, const QList<QSslError> &error)
{
BrowserMainWindow *mainWindow = BrowserApplication::instance()->mainWindow();
QSettings settings;
QList<QSslCertificate> ca_merge = QSslCertificate::fromData(settings.value(QLatin1String("CaCertificates")).toByteArray());
QList<QSslCertificate> ca_new;
QStringList errorStrings;
for (int i = 0; i < error.count(); ++i) {
if (ca_merge.contains(error.at(i).certificate()))
continue;
errorStrings += error.at(i).errorString();
if (!error.at(i).certificate().isNull()) {
ca_new.append(error.at(i).certificate());
}
}
if (errorStrings.isEmpty()) {
reply->ignoreSslErrors();
return;
}
QString errors = errorStrings.join(QLatin1String("\n"));
int ret = QMessageBox::warning(mainWindow, QCoreApplication::applicationName(),
tr("SSL Errors:\n\n%1\n\n%2\n\n"
"Do you want to ignore these errors?").arg(reply->url().toString()).arg(errors),
QMessageBox::Yes | QMessageBox::No,
QMessageBox::No);
if (ret == QMessageBox::Yes) {
if (ca_new.count() > 0) {
ret = QMessageBox::question(mainWindow, QCoreApplication::applicationName(),
tr("Do you want to accept all these certificates?"),
QMessageBox::Yes | QMessageBox::No, QMessageBox::No);
if (ret == QMessageBox::Yes) {
ca_merge += ca_new;
QSslConfiguration sslCfg = QSslConfiguration::defaultConfiguration();
QList<QSslCertificate> ca_list = sslCfg.caCertificates();
ca_list += ca_new;
sslCfg.setCaCertificates(ca_list);
QSslConfiguration::setDefaultConfiguration(sslCfg);
reply->setSslConfiguration(sslCfg);
QByteArray pems;
for (int i = 0; i < ca_merge.count(); ++i)
pems += ca_merge.at(i).toPem() + '\n';
settings.setValue(QLatin1String("CaCertificates"), pems);
}
}
reply->ignoreSslErrors();
}
}
示例5: loadSettings
void NetworkAccessManager::loadSettings()
{
QSettings settings;
settings.beginGroup(QLatin1String("proxy"));
QNetworkProxy proxy;
if (settings.value(QLatin1String("enabled"), false).toBool()) {
int proxyType = settings.value(QLatin1String("type"), 0).toInt();
if (proxyType == 0)
proxy = QNetworkProxy::Socks5Proxy;
else if (proxyType == 1)
proxy = QNetworkProxy::HttpProxy;
else { // 2
proxy.setType(QNetworkProxy::HttpCachingProxy);
#if QT_VERSION >= 0x040500
proxy.setCapabilities(QNetworkProxy::CachingCapability | QNetworkProxy::HostNameLookupCapability);
#endif
}
proxy.setHostName(settings.value(QLatin1String("hostName")).toString());
proxy.setPort(settings.value(QLatin1String("port"), 1080).toInt());
proxy.setUser(settings.value(QLatin1String("userName")).toString());
proxy.setPassword(settings.value(QLatin1String("password")).toString());
}
#if QT_VERSION >= 0x040500
NetworkProxyFactory *proxyFactory = new NetworkProxyFactory;
if (proxy.type() == QNetworkProxy::HttpCachingProxy) {
proxyFactory->setHttpProxy(proxy);
proxyFactory->setGlobalProxy(QNetworkProxy::DefaultProxy);
} else {
proxyFactory->setHttpProxy(QNetworkProxy::DefaultProxy);
proxyFactory->setGlobalProxy(proxy);
}
setProxyFactory(proxyFactory);
#else
setProxy(proxy);
#endif
settings.endGroup();
#ifndef QT_NO_OPENSSL
QSslConfiguration sslCfg = QSslConfiguration::defaultConfiguration();
QList<QSslCertificate> ca_list = sslCfg.caCertificates();
QList<QSslCertificate> ca_new = QSslCertificate::fromData(settings.value(QLatin1String("CaCertificates")).toByteArray());
ca_list += ca_new;
sslCfg.setCaCertificates(ca_list);
QSslConfiguration::setDefaultConfiguration(sslCfg);
#endif
settings.beginGroup(QLatin1String("network"));
QStringList acceptList = settings.value(QLatin1String("acceptLanguages"),
AcceptLanguageDialog::defaultAcceptList()).toStringList();
acceptLanguage = AcceptLanguageDialog::httpString(acceptList);
settings.endGroup();
}
示例6: tr
MobileDialog::MobileDialog( QWidget *parent )
: QDialog( parent )
{
mobileResults["START"] = tr("Signing in process");
mobileResults["REQUEST_OK"] = tr("Request accepted");
mobileResults["EXPIRED_TRANSACTION"] = tr("Request timeout");
mobileResults["USER_CANCEL"] = tr("User denied or cancelled");
mobileResults["SIGNATURE"] = tr("Got signature");
mobileResults["OUTSTANDING_TRANSACTION"] = tr("Request pending");
mobileResults["MID_NOT_READY"] = tr("Mobile-ID not ready, try again later");
mobileResults["PHONE_ABSENT"] = tr("Phone absent");
mobileResults["SENDING_ERROR"] = tr("Request sending error");
mobileResults["SIM_ERROR"] = tr("SIM error");
mobileResults["INTERNAL_ERROR"] = tr("Service internal error");
mobileResults["OCSP_UNAUTHORIZED"] = tr("Not allowed to use OCSP service!<br/>Please check your server access sertificate.");
mobileResults["HOSTNOTFOUND"] = tr("Connecting to SK server failed!<br/>Please check your internet connection.");
mobileResults["User is not a Mobile-ID client"] = tr("User is not a Mobile-ID client");
mobileResults["ID and phone number do not match"] = tr("ID and phone number do not match");
mobileResults["Certificate status unknown"] = tr("Your Mobile-ID service is not activated.");
mobileResults["Certificate is revoked"] = tr("Mobile-ID user certificates are revoked or suspended.");
setupUi( this );
code->setBuddy( signProgressBar );
statusTimer = new QTimeLine( signProgressBar->maximum() * 1000, this );
statusTimer->setCurveShape( QTimeLine::LinearCurve );
statusTimer->setFrameRange( signProgressBar->minimum(), signProgressBar->maximum() );
connect( statusTimer, SIGNAL(frameChanged(int)), signProgressBar, SLOT(setValue(int)) );
connect( statusTimer, SIGNAL(finished()), SLOT(endProgress()) );
manager = new QNetworkAccessManager( this );
connect( manager, SIGNAL(finished(QNetworkReply*)), SLOT(finished(QNetworkReply*)) );
connect( manager, SIGNAL(sslErrors(QNetworkReply*,QList<QSslError>)),
SLOT(sslErrors(QNetworkReply*,QList<QSslError>)) );
if( !Application::confValue( Application::ProxyHost ).toString().isEmpty() )
{
manager->setProxy( QNetworkProxy(
QNetworkProxy::HttpProxy,
Application::confValue( Application::ProxyHost ).toString(),
Application::confValue( Application::ProxyPort ).toUInt(),
Application::confValue( Application::ProxyUser ).toString(),
Application::confValue( Application::ProxyPass ).toString() ) );
}
if( !Application::confValue( Application::PKCS12Disable ).toBool() )
{
QSslConfiguration ssl = QSslConfiguration::defaultConfiguration();
ssl.setCaCertificates( ssl.caCertificates()
#ifdef Q_OS_LINUX
<< QSslCertificate::fromPath( "/usr/share/esteid/certs/*.crt", QSsl::Pem, QRegExp::Wildcard )
#endif
<< QSslCertificate( "-----BEGIN CERTIFICATE-----\n"
"MIIEOzCCAyOgAwIBAgIBADANBgkqhkiG9w0BAQUFADB2MQswCQYDVQQGEwJFRT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"
"7e4lOmUle2ZnrCJXlKf7NDQHg3RWrq04MlUOYak2AFhOo4S/V0LVwvUDt+FCSAwy\n"
"E8FxK6c3HlrwmxWqOCGRVCB3/BrmNouR54ieqMEx7dayoyYfBLvyiSlzZSxoW55O\n"
"ENhgsfPuypAQyuhYab+R65yEtr6sIPJZH2eqGtfWMoaHUAuyOZCfyMFFC1RJ1ymj\n"
"azTRcGFXYtDALf5W/tPUhLJlPE5v6zwRR8Xnzgjohsgnv2aJYHa1e/tT9m+Z9CWA\n"
"BRaz05qjA5N5zEj7Qs9BN5lo07VLgBuSYMl6dsiDU4VfowIDAQABo4HNMIHKMA8G\n"
"A1UdEwEB/wQFMAMBAf8wgZcGA1UdIwSBjzCBjKF/pH0wezELMAkGA1UEBhMCRUUx\n"
"IjAgBgNVBAoTGUFTIFNlcnRpZml0c2VlcmltaXNrZXNrdXMxHjAcBgNVBAsTFVNL\n"
"IHNlcnZpY2VzIGFjY2VzcyBDQTEoMCYGA1UEAxMfU0sgVEVTVCBzZXJ2aWNlcyBh\n"
"Y2Nlc3MgQ0EgMjAxMoIJAIHRdBWILIw0MB0GA1UdDgQWBBQRxbVGxjXI+bcya5iK\n"
"4AW3oXjBrDANBgkqhkiG9w0BAQUFAAOCAQEAHqQ1FiZA1u8Qf1SHSZGpgjmy221x\n"
"DkJ+gYNE0XRDbQ0G0FgqV8peHpIKxEYMGWVCNGRSIenyUYJDVqFMrqMZb1TaYYEg\n"
"Mb5+u3aQpyp9gz3YGh45fvh73M/Pko4WjTsOaIJpXHzGZOSktiuVyEfEkRAupUhY\n"
"7S4gJwPg6RIQXu/FfVCMtNyJliM/5Rz3+NeoLzZw4MVmjQGX0fxXDmVcbSkATqSx\n"
"EV/PbuITu7jOJuDLEr5IpfJPgfl3vBYr2PSo5/2kypth0jikr4TVbGqLFlvU1DaH\n"
//.........这里部分代码省略.........
示例7: setupSocketWithSSLDataSource
void WebSocketQt::setupSocketWithSSLDataSource(SSLDataSource * dataSource)
{
QSslConfiguration config;
QFile localFile(WebSocketQt::toString(dataSource->clientLocalCertificateFilePath()));
if (localFile.open(QIODevice::ReadOnly))
{
QSslCertificate cert(localFile.readAll());
localFile.close();
if (cert.isNull())
{
#ifdef FAYECPP_DEBUG_MESSAGES
qDebug() << "SocketQT: LocalCertificate is NULL";
#endif
}
else
{
config.setLocalCertificate(cert);
}
}
QFile keyFile(WebSocketQt::toString(dataSource->clientPrivateKeyFilePath()));
if (keyFile.open(QIODevice::ReadOnly))
{
QByteArray pp;
pp.append(WebSocketQt::toString(dataSource->clientPrivateKeyPassPhrase()));
QSslKey key(keyFile.readAll(),
QSsl::Rsa,
QSsl::Pem,
QSsl::PrivateKey,
pp);
pp.clear();
keyFile.close();
if (key.isNull())
{
#ifdef FAYECPP_DEBUG_MESSAGES
qDebug() << "SocketQT: PrivateKey is NULL";
#endif
}
else
{
config.setPrivateKey(key);
}
}
QFile caFile(WebSocketQt::toString(dataSource->clientCACertificateFilePath()));
if (caFile.open(QIODevice::ReadOnly))
{
QSslCertificate cert(caFile.readAll());
caFile.close();
if (cert.isNull())
{
#ifdef FAYECPP_DEBUG_MESSAGES
qDebug() << "SocketQT: CACertificate is NULL";
#endif
}
else
{
QList<QSslCertificate> caList(config.caCertificates());
caList.append(cert);
config.setCaCertificates(caList);
}
}
_socket->setSslConfiguration(config);
}
示例8: update
void Server::update() {
if (!((! qsRegName.isEmpty()) && (! qsRegName.isEmpty()) && (! qsRegPassword.isEmpty()) && qurlRegWeb.isValid() && qsPassword.isEmpty() && bAllowPing))
return;
// When QNAM distinguishes connections by client cert, move this to Meta
if (! qnamNetwork)
qnamNetwork = new QNetworkAccessManager(this);
qtTick.start(1000 * (60 * 60 + (qrand() % 300)));
QDomDocument doc;
QDomElement root=doc.createElement(QLatin1String("server"));
doc.appendChild(root);
OSInfo::fillXml(doc, root, meta->qsOS, meta->qsOSVersion, qlBind);
QDomElement tag;
QDomText t;
tag=doc.createElement(QLatin1String("name"));
root.appendChild(tag);
t=doc.createTextNode(qsRegName);
tag.appendChild(t);
tag=doc.createElement(QLatin1String("host"));
root.appendChild(tag);
t=doc.createTextNode(qsRegHost);
tag.appendChild(t);
tag=doc.createElement(QLatin1String("password"));
root.appendChild(tag);
t=doc.createTextNode(qsRegPassword);
tag.appendChild(t);
tag=doc.createElement(QLatin1String("port"));
root.appendChild(tag);
t=doc.createTextNode(QString::number(usPort));
tag.appendChild(t);
tag=doc.createElement(QLatin1String("url"));
root.appendChild(tag);
t=doc.createTextNode(qurlRegWeb.toString());
tag.appendChild(t);
tag=doc.createElement(QLatin1String("digest"));
root.appendChild(tag);
t=doc.createTextNode(getDigest());
tag.appendChild(t);
tag=doc.createElement(QLatin1String("users"));
root.appendChild(tag);
t=doc.createTextNode(QString::number(qhUsers.count()));
tag.appendChild(t);
tag=doc.createElement(QLatin1String("channels"));
root.appendChild(tag);
t=doc.createTextNode(QString::number(qhChannels.count()));
tag.appendChild(t);
QNetworkRequest qnr(QUrl(QLatin1String("https://mumble.hive.no/register.cgi")));
qnr.setHeader(QNetworkRequest::ContentTypeHeader, QLatin1String("text/xml"));
QSslConfiguration ssl = qnr.sslConfiguration();
ssl.setLocalCertificate(qscCert);
ssl.setPrivateKey(qskKey);
/* Work around bug in QSslConfiguration */
QList<QSslCertificate> calist = ssl.caCertificates();
calist << QSslSocket::defaultCaCertificates();
calist << qscCert;
ssl.setCaCertificates(calist);
qnr.setSslConfiguration(ssl);
QNetworkReply *rep = qnamNetwork->post(qnr, doc.toString().toUtf8());
connect(rep, SIGNAL(finished()), this, SLOT(finished()));
connect(rep, SIGNAL(sslErrors(const QList<QSslError> &)), this, SLOT(regSslError(const QList<QSslError> &)));
}
示例9: QDialog
ReceiveCoinsDialog::ReceiveCoinsDialog(const PlatformStyle* platformStyle, QWidget* parent)
: QDialog(parent)
, ui(new Ui::ReceiveCoinsDialog)
, model(0)
, platformStyle(platformStyle)
#if defined(HAVE_WEBENGINE_VIEW) || defined(HAVE_WEBKIT)
, buyView(NULL)
#endif
, buyReceiveAddress(NULL)
, currentAccount(NULL)
{
ui->setupUi(this);
ui->accountRequestPaymentButton->setCursor(Qt::PointingHandCursor);
ui->accountBuyGuldenButton->setCursor(Qt::PointingHandCursor);
ui->accountBuyButton->setCursor(Qt::PointingHandCursor);
ui->accountSaveQRButton->setCursor(Qt::PointingHandCursor);
ui->accountCopyToClipboardButton->setCursor(Qt::PointingHandCursor);
ui->cancelButton->setCursor(Qt::PointingHandCursor);
ui->closeButton->setCursor(Qt::PointingHandCursor);
ui->generateRequestButton->setCursor(Qt::PointingHandCursor);
ui->generateAnotherRequestButton->setCursor(Qt::PointingHandCursor);
connect(ui->accountCopyToClipboardButton, SIGNAL(clicked()), this, SLOT(copyAddressToClipboard()));
connect(ui->accountBuyGuldenButton, SIGNAL(clicked()), this, SLOT(showBuyGuldenDialog()));
connect(ui->accountBuyButton, SIGNAL(clicked()), this, SLOT(buyGulden()));
connect(ui->accountSaveQRButton, SIGNAL(clicked()), this, SLOT(saveQRAsImage()));
connect(ui->accountRequestPaymentButton, SIGNAL(clicked()), this, SLOT(gotoRequestPaymentPage()));
connect(ui->generateAnotherRequestButton, SIGNAL(clicked()), this, SLOT(gotoRequestPaymentPage()));
connect(ui->cancelButton, SIGNAL(clicked()), this, SLOT(cancelRequestPayment()));
connect(ui->closeButton, SIGNAL(clicked()), this, SLOT(cancelRequestPayment()));
connect(ui->generateRequestButton, SIGNAL(clicked()), this, SLOT(generateRequest()));
updateAddress("");
gotoReceievePage();
#ifdef HAVE_WEBENGINE_VIEW
buyView = new WebEngineView(this);
buyView->setAttribute(Qt::WA_TranslucentBackground);
ui->buyGuldenPageLayout->addWidget(buyView);
buyView->show();
ui->loadingAnimationLabel->setObjectName("buy_page_error_text");
#elif defined(HAVE_WEBKIT)
buyView = new WebView(this);
buyView->settings()->setAttribute(QWebSettings::JavascriptEnabled, true);
buyView->settings()->setAttribute(QWebSettings::JavascriptCanOpenWindows, true);
buyView->settings()->setAttribute(QWebSettings::JavascriptCanCloseWindows, true);
buyView->settings()->setAttribute(QWebSettings::PrivateBrowsingEnabled, true);
buyView->settings()->setAttribute(QWebSettings::JavascriptCanAccessClipboard, false);
buyView->settings()->setAttribute(QWebSettings::SpatialNavigationEnabled, true);
buyView->settings()->setAttribute(QWebSettings::LocalContentCanAccessRemoteUrls, true);
buyView->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);
#ifdef MAC_OSX
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(buyView->page()->networkAccessManager(), SIGNAL(sslErrors(QNetworkReply*, const QList<QSslError>&)), this, SLOT(sslErrorHandler(QNetworkReply*, const QList<QSslError>&)));
#endif
ui->buyGuldenPageLayout->addWidget(buyView);
buyView->show();
ui->loadingAnimationLabel->setObjectName("buy_page_error_text");
#else
ui->accountBuyGuldenButton->setVisible(false);
#endif
}