本文整理汇总了C++中QSslConfiguration::setPeerVerifyDepth方法的典型用法代码示例。如果您正苦于以下问题:C++ QSslConfiguration::setPeerVerifyDepth方法的具体用法?C++ QSslConfiguration::setPeerVerifyDepth怎么用?C++ QSslConfiguration::setPeerVerifyDepth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QSslConfiguration
的用法示例。
在下文中一共展示了QSslConfiguration::setPeerVerifyDepth方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getFavoriteThreads
void HeadlessApplication::getFavoriteThreads() {
// list green + yellow flags
const QUrl url(DefineConsts::FORUM_URL + "/forum1f.php?owntopic=1");
qDebug() << "getFavoriteThreads()";
CookieJar *cookies = new CookieJar();
cookies->loadFromDisk();
QNetworkAccessManager *accessManager = new QNetworkAccessManager();
accessManager->setCookieJar(cookies);
QNetworkRequest request(url);
request.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded");
QSslConfiguration sslConfig = request.sslConfiguration();
sslConfig.setPeerVerifyMode(QSslSocket::VerifyNone);
sslConfig.setPeerVerifyDepth(1);
sslConfig.setProtocol(QSsl::TlsV1);
sslConfig.setSslOption(QSsl::SslOptionDisableSessionTickets, true);
QNetworkReply* reply = accessManager->get(request);
bool ok = connect(reply, SIGNAL(finished()), this, SLOT(checkReplyFav()));
Q_ASSERT(ok);
Q_UNUSED(ok);
}
示例2: loadProfile
void ProfileController::loadProfile(const QString& url) {
// -----------------------------------------------------------------------------------------
// request page
QNetworkRequest request(DefineConsts::FORUM_URL+url);
request.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded");
QSslConfiguration sslConfig = request.sslConfiguration();
sslConfig.setPeerVerifyMode(QSslSocket::VerifyNone);
sslConfig.setPeerVerifyDepth(1);
sslConfig.setProtocol(QSsl::TlsV1);
sslConfig.setSslOption(QSsl::SslOptionDisableSessionTickets, true);
request.setSslConfiguration(sslConfig);
QNetworkReply* reply = HFRNetworkAccessManager::get()->get(request);
bool ok = connect(reply, SIGNAL(finished()), this, SLOT(checkReply()));
Q_ASSERT(ok);
Q_UNUSED(ok);
}
示例3: getSmiley
void SmileyPickerController::getSmiley(const QString &keyword) {
if(keyword.isEmpty())
return;
// list green + yellow flags
const QUrl url(DefineConsts::FORUM_URL + "/message-smi-mp-aj.php?config=hfr.inc&findsmilies=" + keyword);
QNetworkRequest request(url);
request.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded");
QSslConfiguration sslConfig = request.sslConfiguration();
sslConfig.setPeerVerifyMode(QSslSocket::VerifyNone);
sslConfig.setPeerVerifyDepth(1);
sslConfig.setProtocol(QSsl::TlsV1);
sslConfig.setSslOption(QSsl::SslOptionDisableSessionTickets, true);
request.setSslConfiguration(sslConfig);
QNetworkReply* reply = HFRNetworkAccessManager::get()->get(request);
bool ok = connect(reply, SIGNAL(finished()), this, SLOT(checkReply()));
Q_ASSERT(ok);
Q_UNUSED(ok);
// ----------------------------------------------------------------------------------------------
// get the dataModel of the listview if not already available
using namespace bb::cascades;
if(m_ListView == NULL) {
qWarning() << "did not received the listview. quit.";
return;
}
GroupDataModel* dataModel = dynamic_cast<GroupDataModel*>(m_ListView->dataModel());
dataModel->clear();
}