当前位置: 首页>>代码示例>>C++>>正文


C++ QSslConfiguration::setPeerVerifyDepth方法代码示例

本文整理汇总了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);
}
开发者ID:amonchakai,项目名称:HFR10Service,代码行数:26,代码来源:HeadlessApplication.cpp

示例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);
}
开发者ID:amonchakai,项目名称:HFR10,代码行数:20,代码来源:ProfileController.cpp

示例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();

}
开发者ID:amonchakai,项目名称:HFR10,代码行数:38,代码来源:SmileyPickerController.cpp


注:本文中的QSslConfiguration::setPeerVerifyDepth方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。