Test for QT_NO_SSL instead of QT_NO_OPENSSL
Change the ifdefs in our own code (except openssl backend) to use the new configure flag. Change-Id: I8774734771c66b22164b5fae8fdb27814ac3df7b Reviewed-by: Richard J. Moore <rich@kde.org>
This commit is contained in:
parent
3fe79f23a9
commit
3f91cde588
@ -151,7 +151,7 @@ void DownloadManager::execute()
|
||||
|
||||
void DownloadManager::sslErrors(const QList<QSslError> &sslErrors)
|
||||
{
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
foreach (const QSslError &error, sslErrors)
|
||||
fprintf(stderr, "SSL error: %s\n", qPrintable(error.errorString()));
|
||||
#endif
|
||||
|
@ -47,7 +47,7 @@
|
||||
HttpWindow::HttpWindow(QWidget *parent)
|
||||
: QDialog(parent)
|
||||
{
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
urlLineEdit = new QLineEdit("https://qt.nokia.com/");
|
||||
#else
|
||||
urlLineEdit = new QLineEdit("http://qt.nokia.com/");
|
||||
@ -75,7 +75,7 @@ HttpWindow::HttpWindow(QWidget *parent)
|
||||
|
||||
connect(&qnam, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)),
|
||||
this, SLOT(slotAuthenticationRequired(QNetworkReply*,QAuthenticator*)));
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
connect(&qnam, SIGNAL(sslErrors(QNetworkReply*,QList<QSslError>)),
|
||||
this, SLOT(sslErrors(QNetworkReply*,QList<QSslError>)));
|
||||
#endif
|
||||
@ -247,7 +247,7 @@ void HttpWindow::slotAuthenticationRequired(QNetworkReply*,QAuthenticator *authe
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
void HttpWindow::sslErrors(QNetworkReply*,const QList<QSslError> &errors)
|
||||
{
|
||||
QString errorString;
|
||||
|
@ -76,7 +76,7 @@ private slots:
|
||||
void updateDataReadProgress(qint64 bytesRead, qint64 totalBytes);
|
||||
void enableDownloadButton();
|
||||
void slotAuthenticationRequired(QNetworkReply*,QAuthenticator *);
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
void sslErrors(QNetworkReply*,const QList<QSslError> &errors);
|
||||
#endif
|
||||
|
||||
|
@ -57,7 +57,7 @@
|
||||
|
||||
#ifndef QT_NO_HTTP
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
# include <private/qsslsocket_p.h>
|
||||
# include <QtNetwork/qsslkey.h>
|
||||
# include <QtNetwork/qsslcipher.h>
|
||||
@ -135,7 +135,7 @@ void QHttpNetworkConnectionPrivate::pauseConnection()
|
||||
|
||||
// Disable all socket notifiers
|
||||
for (int i = 0; i < channelCount; i++) {
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
if (encrypt)
|
||||
QSslSocketPrivate::pauseSocketNotifiers(static_cast<QSslSocket*>(channels[i].socket));
|
||||
else
|
||||
@ -149,7 +149,7 @@ void QHttpNetworkConnectionPrivate::resumeConnection()
|
||||
state = RunningState;
|
||||
// Enable all socket notifiers
|
||||
for (int i = 0; i < channelCount; i++) {
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
if (encrypt)
|
||||
QSslSocketPrivate::resumeSocketNotifiers(static_cast<QSslSocket*>(channels[i].socket));
|
||||
else
|
||||
@ -1181,7 +1181,7 @@ QNetworkProxy QHttpNetworkConnection::transparentProxy() const
|
||||
|
||||
|
||||
// SSL support below
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
void QHttpNetworkConnection::setSslConfiguration(const QSslConfiguration &config)
|
||||
{
|
||||
Q_D(QHttpNetworkConnection);
|
||||
@ -1229,7 +1229,7 @@ void QHttpNetworkConnection::ignoreSslErrors(const QList<QSslError> &errors, int
|
||||
}
|
||||
}
|
||||
|
||||
#endif //QT_NO_OPENSSL
|
||||
#endif //QT_NO_SSL
|
||||
|
||||
#ifndef QT_NO_NETWORKPROXY
|
||||
// only called from QHttpNetworkConnectionChannel::_q_proxyAuthenticationRequired, not
|
||||
|
@ -71,7 +71,7 @@
|
||||
|
||||
#ifndef QT_NO_HTTP
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
# include <QtNetwork/qsslsocket.h>
|
||||
# include <QtNetwork/qsslerror.h>
|
||||
#else
|
||||
@ -120,7 +120,7 @@ public:
|
||||
|
||||
QHttpNetworkConnectionChannel *channels() const;
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
void setSslConfiguration(const QSslConfiguration &config);
|
||||
void ignoreSslErrors(int channel = -1);
|
||||
void ignoreSslErrors(const QList<QSslError> &errors, int channel = -1);
|
||||
|
@ -48,7 +48,7 @@
|
||||
|
||||
#ifndef QT_NO_HTTP
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
# include <QtNetwork/qsslkey.h>
|
||||
# include <QtNetwork/qsslcipher.h>
|
||||
# include <QtNetwork/qsslconfiguration.h>
|
||||
@ -77,7 +77,7 @@ QHttpNetworkConnectionChannel::QHttpNetworkConnectionChannel()
|
||||
, proxyAuthMethod(QAuthenticatorPrivate::None)
|
||||
, authenticationCredentialsSent(false)
|
||||
, proxyCredentialsSent(false)
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
, ignoreAllSslErrors(false)
|
||||
#endif
|
||||
, pipeliningSupported(PipeliningSupportUnknown)
|
||||
@ -90,7 +90,7 @@ QHttpNetworkConnectionChannel::QHttpNetworkConnectionChannel()
|
||||
|
||||
void QHttpNetworkConnectionChannel::init()
|
||||
{
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
if (connection->d_func()->encrypt)
|
||||
socket = new QSslSocket;
|
||||
else
|
||||
@ -139,7 +139,7 @@ void QHttpNetworkConnectionChannel::init()
|
||||
Qt::DirectConnection);
|
||||
#endif
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
QSslSocket *sslSocket = qobject_cast<QSslSocket*>(socket);
|
||||
if (sslSocket) {
|
||||
// won't be a sslSocket if encrypt is false
|
||||
@ -257,7 +257,7 @@ bool QHttpNetworkConnectionChannel::sendRequest()
|
||||
const qint64 socketWriteMaxSize = 16*1024;
|
||||
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
QSslSocket *sslSocket = qobject_cast<QSslSocket*>(socket);
|
||||
// if it is really an ssl socket, check more than just bytesToWrite()
|
||||
while ((socket->bytesToWrite() + (sslSocket ? sslSocket->encryptedBytesToWrite() : 0))
|
||||
@ -598,7 +598,7 @@ bool QHttpNetworkConnectionChannel::ensureConnection()
|
||||
}
|
||||
#endif
|
||||
if (ssl) {
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
QSslSocket *sslSocket = qobject_cast<QSslSocket*>(socket);
|
||||
sslSocket->connectToHostEncrypted(connectHost, connectPort, QIODevice::ReadWrite, networkLayerPreference);
|
||||
if (ignoreAllSslErrors)
|
||||
@ -1117,7 +1117,7 @@ void QHttpNetworkConnectionChannel::_q_uploadDataReadyRead()
|
||||
sendRequest();
|
||||
}
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
void QHttpNetworkConnectionChannel::_q_encrypted()
|
||||
{
|
||||
if (!socket)
|
||||
|
@ -69,7 +69,7 @@
|
||||
|
||||
#ifndef QT_NO_HTTP
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
# include <QtNetwork/qsslsocket.h>
|
||||
# include <QtNetwork/qsslerror.h>
|
||||
#else
|
||||
@ -115,7 +115,7 @@ public:
|
||||
QAuthenticator proxyAuthenticator;
|
||||
bool authenticationCredentialsSent;
|
||||
bool proxyCredentialsSent;
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
bool ignoreAllSslErrors;
|
||||
QList<QSslError> ignoreSslErrorsList;
|
||||
#endif
|
||||
@ -177,7 +177,7 @@ public:
|
||||
|
||||
void _q_uploadDataReadyRead();
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
void _q_encrypted(); // start sending request (https)
|
||||
void _q_sslErrors(const QList<QSslError> &errors); // ssl errors from the socket
|
||||
void _q_encryptedBytesWritten(qint64 bytes); // proceed sending
|
||||
|
@ -46,7 +46,7 @@
|
||||
|
||||
#ifndef QT_NO_HTTP
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
# include <QtNetwork/qsslkey.h>
|
||||
# include <QtNetwork/qsslcipher.h>
|
||||
# include <QtNetwork/qsslconfiguration.h>
|
||||
@ -834,7 +834,7 @@ void QHttpNetworkReplyPrivate::eraseData()
|
||||
|
||||
|
||||
// SSL support below
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
|
||||
QSslConfiguration QHttpNetworkReply::sslConfiguration() const
|
||||
{
|
||||
@ -872,7 +872,7 @@ void QHttpNetworkReply::ignoreSslErrors(const QList<QSslError> &errors)
|
||||
}
|
||||
|
||||
|
||||
#endif //QT_NO_OPENSSL
|
||||
#endif //QT_NO_SSL
|
||||
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -132,7 +132,7 @@ public:
|
||||
|
||||
QHttpNetworkConnection* connection();
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
QSslConfiguration sslConfiguration() const;
|
||||
void setSslConfiguration(const QSslConfiguration &config);
|
||||
void ignoreSslErrors();
|
||||
|
@ -270,7 +270,7 @@ void QHttpThreadDelegate::startRequest()
|
||||
#else
|
||||
httpConnection = new QNetworkAccessCachedHttpConnection(urlCopy.host(), urlCopy.port(), ssl, networkSession);
|
||||
#endif
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
// Set the QSslConfiguration from this QNetworkRequest.
|
||||
if (ssl && incomingSslConfiguration != QSslConfiguration::defaultConfiguration()) {
|
||||
httpConnection->setSslConfiguration(incomingSslConfiguration);
|
||||
@ -312,7 +312,7 @@ void QHttpThreadDelegate::startRequest()
|
||||
// some signals are only interesting when normal asynchronous style is used
|
||||
connect(httpReply,SIGNAL(readyRead()), this, SLOT(readyReadSlot()));
|
||||
connect(httpReply,SIGNAL(dataReadProgress(qint64, qint64)), this, SLOT(dataReadProgressSlot(qint64,qint64)));
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
connect(httpReply,SIGNAL(sslErrors(const QList<QSslError>)), this, SLOT(sslErrorsSlot(QList<QSslError>)));
|
||||
#endif
|
||||
|
||||
@ -377,7 +377,7 @@ void QHttpThreadDelegate::finishedSlot()
|
||||
emit downloadData(httpReply->readAny());
|
||||
}
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
if (ssl)
|
||||
emit sslConfigurationChanged(httpReply->sslConfiguration());
|
||||
#endif
|
||||
@ -427,7 +427,7 @@ void QHttpThreadDelegate::finishedWithErrorSlot(QNetworkReply::NetworkError erro
|
||||
qDebug() << "QHttpThreadDelegate::finishedWithErrorSlot() thread=" << QThread::currentThreadId() << "error=" << errorCode << detail;
|
||||
#endif
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
if (ssl)
|
||||
emit sslConfigurationChanged(httpReply->sslConfiguration());
|
||||
#endif
|
||||
@ -465,7 +465,7 @@ void QHttpThreadDelegate::headerChangedSlot()
|
||||
qDebug() << "QHttpThreadDelegate::headerChangedSlot() thread=" << QThread::currentThreadId();
|
||||
#endif
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
if (ssl)
|
||||
emit sslConfigurationChanged(httpReply->sslConfiguration());
|
||||
#endif
|
||||
@ -530,7 +530,7 @@ void QHttpThreadDelegate::cacheCredentialsSlot(const QHttpNetworkRequest &reques
|
||||
}
|
||||
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
void QHttpThreadDelegate::sslErrorsSlot(const QList<QSslError> &errors)
|
||||
{
|
||||
emit sslConfigurationChanged(httpReply->sslConfiguration());
|
||||
|
@ -88,7 +88,7 @@ public:
|
||||
|
||||
// incoming
|
||||
bool ssl;
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
QSslConfiguration incomingSslConfiguration;
|
||||
#endif
|
||||
QHttpNetworkRequest httpRequest;
|
||||
@ -132,7 +132,7 @@ signals:
|
||||
#ifndef QT_NO_NETWORKPROXY
|
||||
void proxyAuthenticationRequired(const QNetworkProxy &, QAuthenticator *);
|
||||
#endif
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
void sslErrors(const QList<QSslError> &, bool *, QList<QSslError> *);
|
||||
void sslConfigurationChanged(const QSslConfiguration);
|
||||
#endif
|
||||
@ -158,7 +158,7 @@ protected slots:
|
||||
void synchronousHeaderChangedSlot();
|
||||
void dataReadProgressSlot(qint64 done, qint64 total);
|
||||
void cacheCredentialsSlot(const QHttpNetworkRequest &request, QAuthenticator *authenticator);
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
void sslErrorsSlot(const QList<QSslError> &errors);
|
||||
#endif
|
||||
|
||||
|
@ -342,7 +342,7 @@ void QNetworkAccessBackend::redirectionRequested(const QUrl &target)
|
||||
|
||||
void QNetworkAccessBackend::sslErrors(const QList<QSslError> &errors)
|
||||
{
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
reply->sslErrors(errors);
|
||||
#else
|
||||
Q_UNUSED(errors);
|
||||
|
@ -353,7 +353,7 @@ QNetworkAccessManager::QNetworkAccessManager(QObject *parent)
|
||||
#ifndef QT_NO_NETWORKPROXY
|
||||
qRegisterMetaType<QNetworkProxy>("QNetworkProxy");
|
||||
#endif
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
qRegisterMetaType<QList<QSslError> >("QList<QSslError>");
|
||||
qRegisterMetaType<QSslConfiguration>("QSslConfiguration");
|
||||
#endif
|
||||
@ -1011,7 +1011,7 @@ QNetworkReply *QNetworkAccessManager::createRequest(QNetworkAccessManager::Opera
|
||||
priv->backend->reply = priv;
|
||||
}
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
reply->setSslConfiguration(request.sslConfiguration());
|
||||
#endif
|
||||
|
||||
@ -1051,7 +1051,7 @@ void QNetworkAccessManagerPrivate::_q_replyFinished()
|
||||
|
||||
void QNetworkAccessManagerPrivate::_q_replySslErrors(const QList<QSslError> &errors)
|
||||
{
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
Q_Q(QNetworkAccessManager);
|
||||
QNetworkReply *reply = qobject_cast<QNetworkReply *>(q->sender());
|
||||
if (reply)
|
||||
@ -1066,7 +1066,7 @@ QNetworkReply *QNetworkAccessManagerPrivate::postProcess(QNetworkReply *reply)
|
||||
Q_Q(QNetworkAccessManager);
|
||||
QNetworkReplyPrivate::setManager(reply, q);
|
||||
q->connect(reply, SIGNAL(finished()), SLOT(_q_replyFinished()));
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
/* In case we're compiled without SSL support, we don't have this signal and we need to
|
||||
* avoid getting a connection error. */
|
||||
q->connect(reply, SIGNAL(sslErrors(QList<QSslError>)), SLOT(_q_replySslErrors(QList<QSslError>)));
|
||||
|
@ -140,7 +140,7 @@ Q_SIGNALS:
|
||||
#endif
|
||||
void authenticationRequired(QNetworkReply *reply, QAuthenticator *authenticator);
|
||||
void finished(QNetworkReply *reply);
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
void sslErrors(QNetworkReply *reply, const QList<QSslError> &errors);
|
||||
#endif
|
||||
|
||||
|
@ -573,7 +573,7 @@ QVariant QNetworkReply::attribute(QNetworkRequest::Attribute code) const
|
||||
return d_func()->attributes.value(code);
|
||||
}
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
/*!
|
||||
Returns the SSL configuration and state associated with this
|
||||
reply, if SSL was used. It will contain the remote server's
|
||||
|
@ -134,7 +134,7 @@ public:
|
||||
// attributes
|
||||
QVariant attribute(QNetworkRequest::Attribute code) const;
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
QSslConfiguration sslConfiguration() const;
|
||||
void setSslConfiguration(const QSslConfiguration &configuration);
|
||||
void ignoreSslErrors(const QList<QSslError> &errors);
|
||||
@ -147,7 +147,7 @@ Q_SIGNALS:
|
||||
void metaDataChanged();
|
||||
void finished();
|
||||
void error(QNetworkReply::NetworkError);
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
void sslErrors(const QList<QSslError> &errors);
|
||||
#endif
|
||||
|
||||
|
@ -179,7 +179,7 @@ QNetworkReplyHttpImpl::QNetworkReplyHttpImpl(QNetworkAccessManager* const manage
|
||||
d->operation = operation;
|
||||
d->outgoingData = outgoingData;
|
||||
d->url = request.url();
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
d->sslConfiguration = request.sslConfiguration();
|
||||
#endif
|
||||
|
||||
@ -387,7 +387,7 @@ bool QNetworkReplyHttpImpl::canReadLine () const
|
||||
return d->downloadMultiBuffer.canReadLine();
|
||||
}
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
void QNetworkReplyHttpImpl::ignoreSslErrors()
|
||||
{
|
||||
Q_D(QNetworkReplyHttpImpl);
|
||||
@ -441,7 +441,7 @@ QNetworkReplyHttpImplPrivate::QNetworkReplyHttpImplPrivate()
|
||||
, downloadZerocopyBuffer(0)
|
||||
, pendingDownloadDataEmissions(new QAtomicInt())
|
||||
, pendingDownloadProgressEmissions(new QAtomicInt())
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
, pendingIgnoreAllSslErrors(false)
|
||||
#endif
|
||||
|
||||
@ -764,7 +764,7 @@ void QNetworkReplyHttpImplPrivate::postRequest()
|
||||
delegate->transparentProxy = transparentProxy;
|
||||
#endif
|
||||
delegate->ssl = ssl;
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
if (ssl)
|
||||
delegate->incomingSslConfiguration = request.sslConfiguration();
|
||||
#endif
|
||||
@ -809,7 +809,7 @@ void QNetworkReplyHttpImplPrivate::postRequest()
|
||||
QObject::connect(delegate, SIGNAL(error(QNetworkReply::NetworkError,QString)),
|
||||
q, SLOT(httpError(QNetworkReply::NetworkError, const QString)),
|
||||
Qt::QueuedConnection);
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
QObject::connect(delegate, SIGNAL(sslConfigurationChanged(QSslConfiguration)),
|
||||
q, SLOT(replySslConfigurationChanged(QSslConfiguration)),
|
||||
Qt::QueuedConnection);
|
||||
@ -823,7 +823,7 @@ void QNetworkReplyHttpImplPrivate::postRequest()
|
||||
q, SLOT(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)),
|
||||
Qt::BlockingQueuedConnection);
|
||||
#endif
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
QObject::connect(delegate, SIGNAL(sslErrors(QList<QSslError>,bool*,QList<QSslError>*)),
|
||||
q, SLOT(replySslErrors(const QList<QSslError> &, bool *, QList<QSslError> *)),
|
||||
Qt::BlockingQueuedConnection);
|
||||
@ -1202,7 +1202,7 @@ void QNetworkReplyHttpImplPrivate::httpError(QNetworkReply::NetworkError errorCo
|
||||
error(errorCode, errorString);
|
||||
}
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
void QNetworkReplyHttpImplPrivate::replySslErrors(
|
||||
const QList<QSslError> &list, bool *ignoreAll, QList<QSslError> *toBeIgnored)
|
||||
{
|
||||
|
@ -67,7 +67,7 @@
|
||||
#include <private/qnetworkreply_p.h>
|
||||
#include <QtNetwork/QNetworkProxy>
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
#include <QtNetwork/QSslConfiguration>
|
||||
#endif
|
||||
|
||||
@ -113,7 +113,7 @@ public:
|
||||
Q_PRIVATE_SLOT(d_func(), void replyDownloadProgressSlot(qint64,qint64))
|
||||
Q_PRIVATE_SLOT(d_func(), void httpAuthenticationRequired(const QHttpNetworkRequest &, QAuthenticator *))
|
||||
Q_PRIVATE_SLOT(d_func(), void httpError(QNetworkReply::NetworkError, const QString &))
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
Q_PRIVATE_SLOT(d_func(), void replySslErrors(const QList<QSslError> &, bool *, QList<QSslError> *))
|
||||
Q_PRIVATE_SLOT(d_func(), void replySslConfigurationChanged(const QSslConfiguration&))
|
||||
#endif
|
||||
@ -125,7 +125,7 @@ public:
|
||||
Q_PRIVATE_SLOT(d_func(), void emitReplyUploadProgress(qint64, qint64))
|
||||
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
protected:
|
||||
void ignoreSslErrors();
|
||||
void ignoreSslErrorsImplementation(const QList<QSslError> &errors);
|
||||
@ -256,7 +256,7 @@ public:
|
||||
QSharedPointer<QAtomicInt> pendingDownloadProgressEmissions;
|
||||
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
QSslConfiguration sslConfiguration;
|
||||
bool pendingIgnoreAllSslErrors;
|
||||
QList<QSslError> pendingIgnoreSslErrorsList;
|
||||
@ -281,7 +281,7 @@ public:
|
||||
void replyDownloadProgressSlot(qint64,qint64);
|
||||
void httpAuthenticationRequired(const QHttpNetworkRequest &request, QAuthenticator *auth);
|
||||
void httpError(QNetworkReply::NetworkError error, const QString &errorString);
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
void replySslErrors(const QList<QSslError> &, bool *, QList<QSslError> *);
|
||||
void replySslConfigurationChanged(const QSslConfiguration&);
|
||||
#endif
|
||||
|
@ -819,7 +819,7 @@ void QNetworkReplyImplPrivate::redirectionRequested(const QUrl &target)
|
||||
|
||||
void QNetworkReplyImplPrivate::sslErrors(const QList<QSslError> &errors)
|
||||
{
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
Q_Q(QNetworkReplyImpl);
|
||||
emit q->sslErrors(errors);
|
||||
#else
|
||||
@ -930,7 +930,7 @@ void QNetworkReplyImpl::setReadBufferSize(qint64 size)
|
||||
d->backend->setDownstreamLimited(d->readBufferMaxSize > 0);
|
||||
}
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
void QNetworkReplyImpl::sslConfigurationImplementation(QSslConfiguration &configuration) const
|
||||
{
|
||||
Q_D(const QNetworkReplyImpl);
|
||||
@ -958,7 +958,7 @@ void QNetworkReplyImpl::ignoreSslErrorsImplementation(const QList<QSslError> &er
|
||||
if (d->backend)
|
||||
d->backend->ignoreSslErrors(errors);
|
||||
}
|
||||
#endif // QT_NO_OPENSSL
|
||||
#endif // QT_NO_SSL
|
||||
|
||||
/*!
|
||||
\internal
|
||||
|
@ -98,7 +98,7 @@ public:
|
||||
Q_PRIVATE_SLOT(d_func(), void _q_networkSessionFailed())
|
||||
#endif
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
protected:
|
||||
void sslConfigurationImplementation(QSslConfiguration &configuration) const;
|
||||
void setSslConfigurationImplementation(const QSslConfiguration &configuration);
|
||||
|
@ -289,13 +289,13 @@ class QNetworkRequestPrivate: public QSharedData, public QNetworkHeadersPrivate
|
||||
public:
|
||||
inline QNetworkRequestPrivate()
|
||||
: priority(QNetworkRequest::NormalPriority)
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
, sslConfiguration(0)
|
||||
#endif
|
||||
{ qRegisterMetaType<QNetworkRequest>(); }
|
||||
~QNetworkRequestPrivate()
|
||||
{
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
delete sslConfiguration;
|
||||
#endif
|
||||
}
|
||||
@ -307,7 +307,7 @@ public:
|
||||
url = other.url;
|
||||
priority = other.priority;
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
sslConfiguration = 0;
|
||||
if (other.sslConfiguration)
|
||||
sslConfiguration = new QSslConfiguration(*other.sslConfiguration);
|
||||
@ -325,7 +325,7 @@ public:
|
||||
|
||||
QUrl url;
|
||||
QNetworkRequest::Priority priority;
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
mutable QSslConfiguration *sslConfiguration;
|
||||
#endif
|
||||
};
|
||||
@ -526,7 +526,7 @@ void QNetworkRequest::setAttribute(Attribute code, const QVariant &value)
|
||||
d->attributes.remove(code);
|
||||
}
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
/*!
|
||||
Returns this network request's SSL configuration. By default, no
|
||||
SSL settings are specified.
|
||||
|
@ -134,7 +134,7 @@ public:
|
||||
QVariant attribute(Attribute code, const QVariant &defaultValue = QVariant()) const;
|
||||
void setAttribute(Attribute code, const QVariant &value);
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
QSslConfiguration sslConfiguration() const;
|
||||
void setSslConfiguration(const QSslConfiguration &configuration);
|
||||
#endif
|
||||
|
@ -457,7 +457,7 @@
|
||||
#include <qelapsedtimer.h>
|
||||
#include <qscopedvaluerollback.h>
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
#include <QtNetwork/qsslsocket.h>
|
||||
#endif
|
||||
|
||||
@ -2244,7 +2244,7 @@ void QAbstractSocket::abort()
|
||||
#endif
|
||||
if (d->state == UnconnectedState)
|
||||
return;
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
if (QSslSocket *socket = qobject_cast<QSslSocket *>(this)) {
|
||||
socket->abort();
|
||||
return;
|
||||
@ -2303,7 +2303,7 @@ bool QAbstractSocket::atEnd() const
|
||||
bool QAbstractSocket::flush()
|
||||
{
|
||||
Q_D(QAbstractSocket);
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
// Manual polymorphism; flush() isn't virtual, but QSslSocket overloads
|
||||
// it.
|
||||
if (QSslSocket *socket = qobject_cast<QSslSocket *>(this))
|
||||
|
@ -220,7 +220,7 @@ private:
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
Q_DECLARE_METATYPE(QList<QSslError>)
|
||||
#endif
|
||||
|
||||
|
@ -58,7 +58,7 @@ public Q_SLOTS:
|
||||
void finishedReply();
|
||||
void finishedWithError(QNetworkReply::NetworkError errorCode, const QString &detail);
|
||||
void challenge401(const QHttpNetworkRequest &request, QAuthenticator *authenticator);
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
void sslErrors(const QList<QSslError> &errors);
|
||||
#endif
|
||||
private:
|
||||
@ -92,11 +92,11 @@ private Q_SLOTS:
|
||||
void compression_data();
|
||||
void compression();
|
||||
#endif
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
void ignoresslerror_data();
|
||||
void ignoresslerror();
|
||||
#endif
|
||||
#ifdef QT_NO_OPENSSL
|
||||
#ifdef QT_NO_SSL
|
||||
void nossl_data();
|
||||
void nossl();
|
||||
#endif
|
||||
@ -665,7 +665,7 @@ void tst_QHttpNetworkConnection::compression()
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
void tst_QHttpNetworkConnection::sslErrors(const QList<QSslError> &errors)
|
||||
{
|
||||
Q_UNUSED(errors)
|
||||
@ -745,7 +745,7 @@ void tst_QHttpNetworkConnection::ignoresslerror()
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef QT_NO_OPENSSL
|
||||
#ifdef QT_NO_SSL
|
||||
Q_DECLARE_METATYPE(QNetworkReply::NetworkError)
|
||||
void tst_QHttpNetworkConnection::nossl_data()
|
||||
{
|
||||
|
@ -67,7 +67,7 @@
|
||||
#include <QtNetwork/QHttpPart>
|
||||
#include <QtNetwork/QHttpMultiPart>
|
||||
#include <QtNetwork/QNetworkProxyQuery>
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
#include <QtNetwork/qsslerror.h>
|
||||
#include <QtNetwork/qsslconfiguration.h>
|
||||
#endif
|
||||
@ -93,7 +93,7 @@ Q_DECLARE_METATYPE(QNetworkReply::NetworkError)
|
||||
Q_DECLARE_METATYPE(QBuffer*)
|
||||
Q_DECLARE_METATYPE(QHttpMultiPart *)
|
||||
Q_DECLARE_METATYPE(QList<QFile*>) // for multiparts
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
Q_DECLARE_METATYPE(QSslConfiguration)
|
||||
#endif
|
||||
|
||||
@ -143,7 +143,7 @@ class tst_QNetworkReply: public QObject
|
||||
QList<ProxyData> proxies;
|
||||
QNetworkAccessManager manager;
|
||||
MyCookieJar *cookieJar;
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
QSslConfiguration storedSslConfiguration;
|
||||
QList<QSslError> storedExpectedSslErrors;
|
||||
#endif
|
||||
@ -172,7 +172,7 @@ public Q_SLOTS:
|
||||
void proxyAuthenticationRequired(const QNetworkProxy &,QAuthenticator*);
|
||||
void pipeliningHelperSlot();
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
void sslErrors(QNetworkReply*,const QList<QSslError> &);
|
||||
void storeSslConfiguration();
|
||||
void ignoreSslErrorListSlot(QNetworkReply *reply, const QList<QSslError> &);
|
||||
@ -248,7 +248,7 @@ private Q_SLOTS:
|
||||
void ioGetFromHttpWithProxyAuth();
|
||||
void ioGetFromHttpWithProxyAuthSynchronous();
|
||||
void ioGetFromHttpWithSocksProxy();
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
void ioGetFromHttpsWithSslErrors();
|
||||
void ioGetFromHttpsWithIgnoreSslErrors();
|
||||
void ioGetFromHttpsWithSslHandshakeError();
|
||||
@ -336,7 +336,7 @@ private Q_SLOTS:
|
||||
|
||||
void httpRecursiveCreation();
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
void ioPostToHttpsUploadProgress();
|
||||
void ignoreSslErrorsList_data();
|
||||
void ignoreSslErrorsList();
|
||||
@ -378,7 +378,7 @@ private Q_SLOTS:
|
||||
|
||||
void synchronousRequest_data();
|
||||
void synchronousRequest();
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
void synchronousRequestSslFailure();
|
||||
#endif
|
||||
|
||||
@ -450,7 +450,7 @@ QT_END_NAMESPACE
|
||||
QFAIL(qPrintable(errorMsg)); \
|
||||
} while (0);
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
static void setupSslServer(QSslSocket* serverSocket)
|
||||
{
|
||||
QString testDataDir = QFileInfo(QFINDTESTDATA("rfc3252.txt")).absolutePath();
|
||||
@ -504,7 +504,7 @@ protected:
|
||||
client->setSocketDescriptor(socketDescriptor);
|
||||
connectSocketSignals();
|
||||
} else {
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
QSslSocket *serverSocket = new QSslSocket;
|
||||
serverSocket->setParent(this);
|
||||
if (serverSocket->setSocketDescriptor(socketDescriptor)) {
|
||||
@ -541,7 +541,7 @@ private:
|
||||
}
|
||||
|
||||
private slots:
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
void slotSslErrors(const QList<QSslError>& errors)
|
||||
{
|
||||
qDebug() << "slotSslErrors" << client->errorString() << errors;
|
||||
@ -820,7 +820,7 @@ public:
|
||||
}
|
||||
virtual void incomingConnection(qintptr socketDescriptor)
|
||||
{
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
if (doSsl) {
|
||||
QSslSocket *serverSocket = new QSslSocket;
|
||||
serverSocket->setParent(this);
|
||||
@ -837,7 +837,7 @@ public:
|
||||
}
|
||||
private slots:
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
void slotSslErrors(const QList<QSslError>& errors)
|
||||
{
|
||||
qDebug() << "slotSslErrors" << sslSocket->errorString() << errors;
|
||||
@ -1104,7 +1104,7 @@ tst_QNetworkReply::tst_QNetworkReply()
|
||||
qRegisterMetaType<QNetworkReply *>(); // for QSignalSpy
|
||||
qRegisterMetaType<QAuthenticator *>();
|
||||
qRegisterMetaType<QNetworkProxy>();
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
qRegisterMetaType<QList<QSslError> >();
|
||||
#endif
|
||||
qRegisterMetaType<QNetworkReply::NetworkError>();
|
||||
@ -1150,7 +1150,7 @@ void tst_QNetworkReply::proxyAuthenticationRequired(const QNetworkProxy &, QAuth
|
||||
auth->setPassword("password");
|
||||
}
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
void tst_QNetworkReply::sslErrors(QNetworkReply *reply, const QList<QSslError> &errors)
|
||||
{
|
||||
reply->ignoreSslErrors();
|
||||
@ -1345,7 +1345,7 @@ void tst_QNetworkReply::initTestCase()
|
||||
#endif
|
||||
|
||||
QDir::setSearchPaths("testdata", QStringList() << testDataDir);
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
QSslSocket::defaultCaCertificates(); //preload certificates
|
||||
#endif
|
||||
#ifndef QT_NO_BEARERMANAGEMENT
|
||||
@ -3135,7 +3135,7 @@ void tst_QNetworkReply::ioGetFromHttpWithSocksProxy()
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
void tst_QNetworkReply::ioGetFromHttpsWithSslErrors()
|
||||
{
|
||||
qRegisterMetaType<QNetworkReply*>(); // for QSignalSpy
|
||||
@ -3559,7 +3559,7 @@ void tst_QNetworkReply::ioGetWithManyProxies_data()
|
||||
<< "ftp://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt"
|
||||
<< QNetworkReply::NoError;
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
// HTTPS with HTTP transparent proxy
|
||||
proxyList.clear();
|
||||
proxyList << QNetworkProxy(QNetworkProxy::HttpProxy, QtNetworkSettings::serverName(), 3129);
|
||||
@ -3604,7 +3604,7 @@ void tst_QNetworkReply::ioGetWithManyProxies_data()
|
||||
<< "ftp://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt"
|
||||
<< QNetworkReply::ProxyNotFoundError;
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
// HTTPS with HTTP caching proxy
|
||||
proxyList.clear();
|
||||
proxyList << QNetworkProxy(QNetworkProxy::HttpCachingProxy, QtNetworkSettings::serverName(), 3129);
|
||||
@ -3679,7 +3679,7 @@ void tst_QNetworkReply::ioGetWithManyProxies_data()
|
||||
<< "ftp://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt"
|
||||
<< QNetworkReply::NoError;
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
// HTTPS request with HTTP Caching + HTTP transparent
|
||||
proxyList.clear();
|
||||
proxyList << QNetworkProxy(QNetworkProxy::HttpCachingProxy, QtNetworkSettings::serverName(), 3129)
|
||||
@ -3726,7 +3726,7 @@ void tst_QNetworkReply::ioGetWithManyProxies()
|
||||
QSignalSpy authspy(&manager, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)));
|
||||
connect(&manager, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)),
|
||||
SLOT(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)));
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
connect(&manager, SIGNAL(sslErrors(QNetworkReply*,QList<QSslError>)),
|
||||
SLOT(sslErrors(QNetworkReply*,QList<QSslError>)));
|
||||
#endif
|
||||
@ -3735,7 +3735,7 @@ void tst_QNetworkReply::ioGetWithManyProxies()
|
||||
|
||||
manager.disconnect(SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)),
|
||||
this, SLOT(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)));
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
manager.disconnect(SIGNAL(sslErrors(QNetworkReply*,QList<QSslError>)),
|
||||
this, SLOT(sslErrors(QNetworkReply*,QList<QSslError>)));
|
||||
#endif
|
||||
@ -4324,7 +4324,7 @@ void tst_QNetworkReply::ioPostToHttpNoBufferFlag()
|
||||
QCOMPARE(reply->error(), QNetworkReply::ContentReSendError);
|
||||
}
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
class SslServer : public QTcpServer {
|
||||
Q_OBJECT
|
||||
public:
|
||||
@ -4437,7 +4437,7 @@ void tst_QNetworkReply::ioGetFromBuiltinHttp_data()
|
||||
QTest::addColumn<int>("bufferSize");
|
||||
QTest::newRow("http+unlimited") << false << 0;
|
||||
QTest::newRow("http+limited") << false << 4096;
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
QTest::newRow("https+unlimited") << true << 0;
|
||||
QTest::newRow("https+limited") << true << 4096;
|
||||
#endif
|
||||
@ -5123,7 +5123,7 @@ void tst_QNetworkReply::httpProxyCommands_data()
|
||||
<< QUrl("http://0.0.0.0:4443/http-request")
|
||||
<< QByteArray("HTTP/1.0 200 OK\r\nProxy-Connection: close\r\nContent-Length: 1\r\n\r\n1")
|
||||
<< "GET http://0.0.0.0:4443/http-request HTTP/1.";
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
QTest::newRow("https")
|
||||
<< QUrl("https://0.0.0.0:4443/https-request")
|
||||
<< QByteArray("HTTP/1.0 200 Connection Established\r\n\r\n")
|
||||
@ -5539,7 +5539,7 @@ void tst_QNetworkReply::httpRecursiveCreation()
|
||||
QVERIFY(!QTestEventLoop::instance().timeout());
|
||||
}
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
void tst_QNetworkReply::ignoreSslErrorsList_data()
|
||||
{
|
||||
QTest::addColumn<QString>("url");
|
||||
@ -5637,7 +5637,7 @@ void tst_QNetworkReply::sslConfiguration()
|
||||
QCOMPARE(reply->error(), expectedError);
|
||||
}
|
||||
|
||||
#endif // QT_NO_OPENSSL
|
||||
#endif // QT_NO_SSL
|
||||
|
||||
void tst_QNetworkReply::getAndThenDeleteObject_data()
|
||||
{
|
||||
@ -6071,7 +6071,7 @@ void tst_QNetworkReply::authenticationCacheAfterCancel_data()
|
||||
QTest::addColumn<QUrl>("url");
|
||||
for (int i = 0; i < proxies.count(); ++i) {
|
||||
QTest::newRow("http" + proxies.at(i).tag) << proxies.at(i).proxy << proxies.at(i).requiresAuthentication << QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/rfcs-auth/rfc3252.txt");
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
QTest::newRow("https" + proxies.at(i).tag) << proxies.at(i).proxy << proxies.at(i).requiresAuthentication << QUrl("https://" + QtNetworkSettings::serverName() + "/qtest/rfcs-auth/rfc3252.txt");
|
||||
#endif
|
||||
}
|
||||
@ -6124,7 +6124,7 @@ void tst_QNetworkReply::authenticationCacheAfterCancel()
|
||||
QFETCH(bool, proxyAuth);
|
||||
QFETCH(QUrl, url);
|
||||
QNetworkAccessManager manager;
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
connect(&manager, SIGNAL(sslErrors(QNetworkReply*,QList<QSslError>)),
|
||||
SLOT(sslErrors(QNetworkReply*,QList<QSslError>)));
|
||||
#endif
|
||||
@ -6251,7 +6251,7 @@ void tst_QNetworkReply::authenticationWithDifferentRealm()
|
||||
{
|
||||
AuthenticationCacheHelper helper;
|
||||
QNetworkAccessManager manager;
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
connect(&manager, SIGNAL(sslErrors(QNetworkReply*,QList<QSslError>)),
|
||||
SLOT(sslErrors(QNetworkReply*,QList<QSslError>)));
|
||||
#endif
|
||||
@ -6436,7 +6436,7 @@ void tst_QNetworkReply::synchronousRequest_data()
|
||||
// ### we would need to enflate (un-deflate) the file content and compare the sizes
|
||||
<< QString("text/plain");
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
QTest::newRow("https")
|
||||
<< QUrl("https://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt")
|
||||
<< QString("file:" + testDataDir + "/rfc3252.txt")
|
||||
@ -6467,7 +6467,7 @@ void tst_QNetworkReply::synchronousRequest()
|
||||
|
||||
QNetworkRequest request(url);
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
// workaround for HTTPS requests: add self-signed server cert to list of CA certs,
|
||||
// since we cannot react to the sslErrors() signal
|
||||
// to fix this properly we would need to have an ignoreSslErrors() method in the
|
||||
@ -6512,7 +6512,7 @@ void tst_QNetworkReply::synchronousRequest()
|
||||
reply->deleteLater();
|
||||
}
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
void tst_QNetworkReply::synchronousRequestSslFailure()
|
||||
{
|
||||
// test that SSL won't be accepted with self-signed certificate,
|
||||
|
@ -68,7 +68,7 @@
|
||||
#include <QStringList>
|
||||
#include <QTcpServer>
|
||||
#include <QTcpSocket>
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
#include <QSslSocket>
|
||||
#endif
|
||||
#include <QTextStream>
|
||||
@ -332,7 +332,7 @@ void tst_QTcpSocket::initTestCase_data()
|
||||
QTest::newRow("WithHttpProxyBasicAuth") << true << int(HttpProxy | AuthBasic) << false;
|
||||
// QTest::newRow("WithHttpProxyNtlmAuth") << true << int(HttpProxy | AuthNtlm) << false;
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
QTest::newRow("WithoutProxy SSL") << false << 0 << true;
|
||||
QTest::newRow("WithSocks5Proxy SSL") << true << int(Socks5Proxy) << true;
|
||||
QTest::newRow("WithSocks5AuthProxy SSL") << true << int(Socks5Proxy | AuthBasic) << true;
|
||||
@ -392,7 +392,7 @@ void tst_QTcpSocket::init()
|
||||
QTcpSocket *tst_QTcpSocket::newSocket() const
|
||||
{
|
||||
QTcpSocket *socket;
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
QFETCH_GLOBAL(bool, ssl);
|
||||
socket = ssl ? new QSslSocket : new QTcpSocket;
|
||||
#else
|
||||
@ -1640,7 +1640,7 @@ public:
|
||||
protected:
|
||||
inline void run()
|
||||
{
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
QFETCH_GLOBAL(bool, ssl);
|
||||
if (ssl)
|
||||
socket = new QSslSocket;
|
||||
@ -1924,7 +1924,7 @@ public:
|
||||
attemptedToConnect = false;
|
||||
networkTimeout = false;
|
||||
count = 0;
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
QFETCH_GLOBAL(bool, ssl);
|
||||
if (ssl)
|
||||
sock = new QSslSocket;
|
||||
|
@ -66,7 +66,7 @@ class tst_QSslCertificate : public QObject
|
||||
QMap<QString, QString> sha1Map;
|
||||
|
||||
void createTestRows();
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
void compareCertificates(const QSslCertificate & cert1, const QSslCertificate & cert2);
|
||||
#endif
|
||||
|
||||
@ -76,7 +76,7 @@ public slots:
|
||||
void initTestCase();
|
||||
void cleanupTestCase();
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
private slots:
|
||||
void emptyConstructor();
|
||||
void constructor_data();
|
||||
@ -173,7 +173,7 @@ static QByteArray readFile(const QString &absFilePath)
|
||||
return file.readAll();
|
||||
}
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
|
||||
void tst_QSslCertificate::emptyConstructor()
|
||||
{
|
||||
@ -1060,7 +1060,7 @@ void tst_QSslCertificate::extensions()
|
||||
}
|
||||
|
||||
|
||||
#endif // QT_NO_OPENSSL
|
||||
#endif // QT_NO_SSL
|
||||
|
||||
QTEST_MAIN(tst_QSslCertificate)
|
||||
#include "tst_qsslcertificate.moc"
|
||||
|
@ -59,7 +59,7 @@ public slots:
|
||||
void init();
|
||||
void cleanup();
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
|
||||
private slots:
|
||||
void constructing();
|
||||
@ -88,14 +88,14 @@ void tst_QSslCipher::cleanup()
|
||||
{
|
||||
}
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
|
||||
void tst_QSslCipher::constructing()
|
||||
{
|
||||
QSslCipher cipher;
|
||||
}
|
||||
|
||||
#endif // QT_NO_OPENSSL
|
||||
#endif // QT_NO_SSL
|
||||
|
||||
QTEST_MAIN(tst_QSslCipher)
|
||||
#include "tst_qsslcipher.moc"
|
||||
|
@ -77,7 +77,7 @@ public slots:
|
||||
void init();
|
||||
void cleanup();
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
private slots:
|
||||
void constructing();
|
||||
#endif
|
||||
@ -109,14 +109,14 @@ void tst_QSslError::cleanup()
|
||||
{
|
||||
}
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
|
||||
void tst_QSslError::constructing()
|
||||
{
|
||||
QSslError error;
|
||||
}
|
||||
|
||||
#endif // QT_NO_OPENSSL
|
||||
#endif // QT_NO_SSL
|
||||
|
||||
QTEST_MAIN(tst_QSslError)
|
||||
#include "tst_qsslerror.moc"
|
||||
|
@ -71,7 +71,7 @@ class tst_QSslKey : public QObject
|
||||
public slots:
|
||||
void initTestCase();
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
|
||||
private slots:
|
||||
void emptyConstructor();
|
||||
@ -123,7 +123,7 @@ static QByteArray readFile(const QString &absFilePath)
|
||||
return file.readAll();
|
||||
}
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
|
||||
void tst_QSslKey::emptyConstructor()
|
||||
{
|
||||
|
@ -55,7 +55,7 @@
|
||||
#include <QAuthenticator>
|
||||
|
||||
#include "private/qhostinfo_p.h"
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
#include "private/qsslsocket_openssl_p.h"
|
||||
#include "private/qsslsocket_openssl_symbols_p.h"
|
||||
#include "private/qsslconfiguration_p.h"
|
||||
@ -65,7 +65,7 @@
|
||||
|
||||
Q_DECLARE_METATYPE(QAbstractSocket::SocketState)
|
||||
Q_DECLARE_METATYPE(QAbstractSocket::SocketError)
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
Q_DECLARE_METATYPE(QSslSocket::SslMode)
|
||||
typedef QList<QSslError::SslError> SslErrorList;
|
||||
Q_DECLARE_METATYPE(SslErrorList)
|
||||
@ -80,7 +80,7 @@ Q_DECLARE_METATYPE(QSslConfiguration)
|
||||
#define QSSLSOCKET_CERTUNTRUSTED_WORKAROUND
|
||||
#endif
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
class QSslSocketPtr: public QSharedPointer<QSslSocket>
|
||||
{
|
||||
public:
|
||||
@ -113,7 +113,7 @@ public:
|
||||
return QTestEventLoop::instance().timeout();
|
||||
}
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
QSslSocketPtr newSocket();
|
||||
#endif
|
||||
|
||||
@ -124,7 +124,7 @@ public slots:
|
||||
void cleanup();
|
||||
void proxyAuthenticationRequired(const QNetworkProxy &, QAuthenticator *auth);
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
private slots:
|
||||
void constructing();
|
||||
void simpleConnect();
|
||||
@ -226,7 +226,7 @@ protected slots:
|
||||
private:
|
||||
QSslSocket *socket;
|
||||
QList<QSslError> storedExpectedSslErrors;
|
||||
#endif // QT_NO_OPENSSL
|
||||
#endif // QT_NO_SSL
|
||||
private:
|
||||
static int loopLevel;
|
||||
};
|
||||
@ -235,7 +235,7 @@ int tst_QSslSocket::loopLevel = 0;
|
||||
|
||||
tst_QSslSocket::tst_QSslSocket()
|
||||
{
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
qRegisterMetaType<QList<QSslError> >("QList<QSslError>");
|
||||
qRegisterMetaType<QSslError>("QSslError");
|
||||
qRegisterMetaType<QAbstractSocket::SocketState>("QAbstractSocket::SocketState");
|
||||
@ -320,7 +320,7 @@ void tst_QSslSocket::cleanup()
|
||||
QNetworkProxy::setApplicationProxy(QNetworkProxy::DefaultProxy);
|
||||
}
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
QSslSocketPtr tst_QSslSocket::newSocket()
|
||||
{
|
||||
QSslSocket *socket = new QSslSocket;
|
||||
@ -341,7 +341,7 @@ void tst_QSslSocket::proxyAuthenticationRequired(const QNetworkProxy &, QAuthent
|
||||
auth->setPassword("password");
|
||||
}
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
|
||||
void tst_QSslSocket::constructing()
|
||||
{
|
||||
@ -2216,7 +2216,7 @@ void tst_QSslSocket::setEmptyDefaultConfiguration() // this test should be last,
|
||||
QVERIFY2(!socket->waitForEncrypted(4000), qPrintable(socket->errorString()));
|
||||
}
|
||||
|
||||
#endif // QT_NO_OPENSSL
|
||||
#endif // QT_NO_SSL
|
||||
|
||||
QTEST_MAIN(tst_QSslSocket)
|
||||
|
||||
|
@ -80,7 +80,7 @@ private slots:
|
||||
void httpServerFiles();
|
||||
void httpServerCGI_data();
|
||||
void httpServerCGI();
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
void httpsServer();
|
||||
#endif
|
||||
void httpProxy();
|
||||
@ -188,14 +188,14 @@ static bool doSocketRead(QTcpSocket *socket, int minBytesAvailable, int timeout
|
||||
|
||||
static bool doSocketFlush(QTcpSocket *socket, int timeout = 4000)
|
||||
{
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
QSslSocket *sslSocket = qobject_cast<QSslSocket *>(socket);
|
||||
#endif
|
||||
QTime timer;
|
||||
timer.start();
|
||||
forever {
|
||||
if (socket->bytesToWrite() == 0
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
&& sslSocket->encryptedBytesToWrite() == 0
|
||||
#endif
|
||||
)
|
||||
@ -210,7 +210,7 @@ static bool doSocketFlush(QTcpSocket *socket, int timeout = 4000)
|
||||
|
||||
static void netChat(int port, const QList<Chat> &chat)
|
||||
{
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
QSslSocket socket;
|
||||
#else
|
||||
QTcpSocket socket;
|
||||
@ -322,7 +322,7 @@ static void netChat(int port, const QList<Chat> &chat)
|
||||
break;
|
||||
|
||||
case Chat::StartEncryption:
|
||||
#ifdef QT_NO_OPENSSL
|
||||
#ifdef QT_NO_SSL
|
||||
QFAIL("Internal error: SSL required for this test");
|
||||
#else
|
||||
qDebug() << i << "Starting client encryption";
|
||||
@ -745,7 +745,7 @@ void tst_NetworkSelfTest::httpServerCGI()
|
||||
netChat(80, chat);
|
||||
}
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
void tst_NetworkSelfTest::httpsServer()
|
||||
{
|
||||
netChat(443, QList<Chat>()
|
||||
@ -937,7 +937,7 @@ void tst_NetworkSelfTest::socks5ProxyAuth()
|
||||
|
||||
void tst_NetworkSelfTest::supportsSsl()
|
||||
{
|
||||
#ifdef QT_NO_OPENSSL
|
||||
#ifdef QT_NO_SSL
|
||||
QFAIL("SSL not compiled in");
|
||||
#else
|
||||
QVERIFY2(QSslSocket::supportsSsl(), "Could not load SSL libraries");
|
||||
|
@ -457,7 +457,7 @@ private slots:
|
||||
void initTestCase();
|
||||
void httpLatency();
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
void echoPerformance_data();
|
||||
void echoPerformance();
|
||||
#endif
|
||||
@ -491,7 +491,7 @@ void tst_qnetworkreply::httpLatency()
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
void tst_qnetworkreply::echoPerformance_data()
|
||||
{
|
||||
QTest::addColumn<bool>("ssl");
|
||||
|
@ -100,7 +100,7 @@ void tst_qnetworkreply::limiting_data()
|
||||
QTest::addColumn<QUrl>("url");
|
||||
|
||||
QTest::newRow("HTTP") << QUrl("http://" + QtNetworkSettings::serverName() + "/mediumfile");
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#ifndef QT_NO_SSL
|
||||
QTest::newRow("HTTP+SSL") << QUrl("https://" + QtNetworkSettings::serverName() + "/mediumfile");
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user