本文整理汇总了C++中QSslConfiguration::isNull方法的典型用法代码示例。如果您正苦于以下问题:C++ QSslConfiguration::isNull方法的具体用法?C++ QSslConfiguration::isNull怎么用?C++ QSslConfiguration::isNull使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QSslConfiguration
的用法示例。
在下文中一共展示了QSslConfiguration::isNull方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: replyFinished
void QNetworkAccessHttpBackend::replyFinished()
{
if (httpReply->bytesAvailable())
// we haven't read everything yet. Wait some more.
return;
int statusCode = httpReply->statusCode();
if (statusCode >= 400) {
// it's an error reply
QString msg = QLatin1String(QT_TRANSLATE_NOOP("QNetworkReply",
"Error downloading %1 - server replied: %2"));
msg = msg.arg(url().toString(), httpReply->reasonPhrase());
error(statusCodeFromHttp(httpReply->statusCode(), httpReply->url()), msg);
}
#ifndef QT_NO_OPENSSL
// store the SSL configuration now
// once we call finished(), we won't have access to httpReply anymore
QSslConfiguration sslConfig = httpReply->sslConfiguration();
if (pendingSslConfiguration)
*pendingSslConfiguration = sslConfig;
else if (!sslConfig.isNull())
pendingSslConfiguration = new QSslConfiguration(sslConfig);
#endif
finished();
}
示例2: setSslConfiguration
/*!
Sets the SSL configuration for the network connection associated
with this request, if possible, to be that of \a config.
*/
void QNetworkReply::setSslConfiguration(const QSslConfiguration &config)
{
if (config.isNull())
return;
int id = metaObject()->indexOfMethod("setSslConfigurationImplementation(QSslConfiguration)");
if (id != -1) {
QSslConfiguration copy(config);
void *arr[] = { 0, © };
qt_metacall(QMetaObject::InvokeMetaMethod, id, arr);
}
}
示例3: qSslProtocolFromString
bool KIO::Integration::sslConfigFromMetaData(const KIO::MetaData& metadata, QSslConfiguration& sslconfig)
{
bool success = false;
if (metadata.contains(QL1S("ssl_in_use"))) {
const QSsl::SslProtocol sslProto = qSslProtocolFromString(metadata.value(QL1S("ssl_protocol_version")));
QList<QSslCipher> cipherList;
cipherList << QSslCipher(metadata.value(QL1S("ssl_cipher_name")), sslProto);
sslconfig.setCaCertificates(QSslCertificate::fromData(metadata.value(QL1S("ssl_peer_chain")).toUtf8()));
sslconfig.setCiphers(cipherList);
sslconfig.setProtocol(sslProto);
success = sslconfig.isNull();
}
return success;
}
示例4: PyBool_FromLong
static PyObject *meth_QSslConfiguration_isNull(PyObject *sipSelf, PyObject *sipArgs)
{
PyObject *sipParseErr = NULL;
{
QSslConfiguration *sipCpp;
if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QSslConfiguration, &sipCpp))
{
bool sipRes;
Py_BEGIN_ALLOW_THREADS
sipRes = sipCpp->isNull();
Py_END_ALLOW_THREADS
return PyBool_FromLong(sipRes);
}
}
示例5: setSslConfigurationImplementation
void QNetworkReplyImpl::setSslConfigurationImplementation(const QSslConfiguration &config)
{
Q_D(QNetworkReplyImpl);
if (d->backend && !config.isNull())
d->backend->setSslConfiguration(config);
}
示例6: slotReplyFinished
//
// There have been problems with the finish-signal coming from the networkmanager.
// To avoid that, the reply-signals were connected and the data is taken from the
// sender() method.
//
void ownCloudInfo::slotReplyFinished()
{
QNetworkReply *reply = qobject_cast<QNetworkReply *>(sender());
QSslConfiguration sslConfig = reply->sslConfiguration();
if (!sslConfig.isNull()) {
QMutexLocker lock(&_certChainMutex);
_certificateChain = sslConfig.peerCertificateChain();
}
if( ! reply ) {
qDebug() << "ownCloudInfo: Reply empty!";
return;
}
// Detect redirect url
QUrl possibleRedirUrl = reply->attribute(QNetworkRequest::RedirectionTargetAttribute).toUrl();
/* We'll deduct if the redirection is valid in the redirectUrl function */
if (!possibleRedirUrl.isEmpty() && _redirectCount++ > 10) {
// Are we in a redirect loop
qDebug() << "Redirect loop while redirecting to" << possibleRedirUrl;
possibleRedirUrl.clear();
}
if(!possibleRedirUrl.isEmpty()) {
QString configHandle;
qDebug() << "Redirected to " << possibleRedirUrl;
// We'll do another request to the redirection url.
// an empty config handle is ok for the default config.
if( _configHandleMap.contains(reply) ) {
configHandle = _configHandleMap[reply];
qDebug() << "Redirect: Have a custom config handle: " << configHandle;
}
QString path = _directories[reply];
if (path.isEmpty()) {
path = QLatin1String("status.php");
} else {
path.prepend( QLatin1String(WEBDAV_PATH) );
}
qDebug() << "This path was redirected: " << path;
QString newUrl = possibleRedirUrl.toString();
if( !path.isEmpty() && newUrl.endsWith( path )) {
// cut off the trailing path
newUrl.chop( path.length() );
_urlRedirectedTo = newUrl;
qDebug() << "Updated url to" << newUrl;
getRequest( possibleRedirUrl );
} else {
qDebug() << "WRN: Path is not part of the redirect URL. NO redirect.";
}
reply->deleteLater();
_directories.remove(reply);
_configHandleMap.remove(reply);
return;
}
// TODO: check if this is always the correct encoding
const QString version = QString::fromUtf8( reply->readAll() );
const QString url = reply->url().toString();
QString plainUrl(url);
plainUrl.remove( QLatin1String("/status.php"));
QString info( version );
if( url.endsWith( QLatin1String("status.php")) ) {
// it was a call to status.php
if( reply->error() == QNetworkReply::NoError && info.isEmpty() ) {
// This seems to be a bit strange behaviour of QNetworkAccessManager.
// It calls the finised slot multiple times but only the first read wins.
// That happend when the code connected the finished signal of the manager.
// It did not happen when the code connected to the reply finish signal.
qDebug() << "WRN: NetworkReply with not content but also no error! " << reply;
reply->deleteLater();
return;
}
qDebug() << "status.php returns: " << info << " " << reply->error() << " Reply: " << reply;
if( info.contains(QLatin1String("installed"))
&& info.contains(QLatin1String("version"))
&& info.contains(QLatin1String("versionstring")) ) {
info.remove(0,1); // remove first char which is a "{"
info.remove(-1,1); // remove the last char which is a "}"
QStringList li = info.split( QLatin1Char(',') );
QString versionStr;
QString version;
QString edition;
foreach ( const QString& infoString, li ) {
QStringList touple = infoString.split( QLatin1Char(':'));
QString key = touple[0];
//.........这里部分代码省略.........