From 3f91cde588ad32277ba06d625ed36256ec65f88e Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Mon, 20 Feb 2012 17:02:41 +0000 Subject: 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 --- examples/network/download/main.cpp | 2 +- examples/network/http/httpwindow.cpp | 6 +- examples/network/http/httpwindow.h | 2 +- src/network/access/qhttpnetworkconnection.cpp | 10 ++-- src/network/access/qhttpnetworkconnection_p.h | 4 +- .../access/qhttpnetworkconnectionchannel.cpp | 14 ++--- .../access/qhttpnetworkconnectionchannel_p.h | 6 +- src/network/access/qhttpnetworkreply.cpp | 6 +- src/network/access/qhttpnetworkreply_p.h | 2 +- src/network/access/qhttpthreaddelegate.cpp | 12 ++-- src/network/access/qhttpthreaddelegate_p.h | 6 +- src/network/access/qnetworkaccessbackend.cpp | 2 +- src/network/access/qnetworkaccessmanager.cpp | 8 +-- src/network/access/qnetworkaccessmanager.h | 2 +- src/network/access/qnetworkreply.cpp | 2 +- src/network/access/qnetworkreply.h | 4 +- src/network/access/qnetworkreplyhttpimpl.cpp | 14 ++--- src/network/access/qnetworkreplyhttpimpl_p.h | 10 ++-- src/network/access/qnetworkreplyimpl.cpp | 6 +- src/network/access/qnetworkreplyimpl_p.h | 2 +- src/network/access/qnetworkrequest.cpp | 10 ++-- src/network/access/qnetworkrequest.h | 2 +- src/network/socket/qabstractsocket.cpp | 6 +- src/network/ssl/qsslsocket.h | 2 +- .../tst_qhttpnetworkconnection.cpp | 10 ++-- .../access/qnetworkreply/tst_qnetworkreply.cpp | 64 +++++++++++----------- .../network/socket/qtcpsocket/tst_qtcpsocket.cpp | 10 ++-- .../ssl/qsslcertificate/tst_qsslcertificate.cpp | 8 +-- .../auto/network/ssl/qsslcipher/tst_qsslcipher.cpp | 6 +- tests/auto/network/ssl/qsslerror/tst_qsslerror.cpp | 6 +- tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp | 4 +- .../auto/network/ssl/qsslsocket/tst_qsslsocket.cpp | 20 +++---- .../other/networkselftest/tst_networkselftest.cpp | 14 ++--- .../access/qnetworkreply/tst_qnetworkreply.cpp | 4 +- tests/manual/qnetworkreply/main.cpp | 2 +- 35 files changed, 144 insertions(+), 144 deletions(-) diff --git a/examples/network/download/main.cpp b/examples/network/download/main.cpp index aea42a540c..ae3aa1f78b 100644 --- a/examples/network/download/main.cpp +++ b/examples/network/download/main.cpp @@ -151,7 +151,7 @@ void DownloadManager::execute() void DownloadManager::sslErrors(const QList &sslErrors) { -#ifndef QT_NO_OPENSSL +#ifndef QT_NO_SSL foreach (const QSslError &error, sslErrors) fprintf(stderr, "SSL error: %s\n", qPrintable(error.errorString())); #endif diff --git a/examples/network/http/httpwindow.cpp b/examples/network/http/httpwindow.cpp index 2f5f739853..c56a6fa53f 100644 --- a/examples/network/http/httpwindow.cpp +++ b/examples/network/http/httpwindow.cpp @@ -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)), this, SLOT(sslErrors(QNetworkReply*,QList))); #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 &errors) { QString errorString; diff --git a/examples/network/http/httpwindow.h b/examples/network/http/httpwindow.h index 54587b2f6d..a3694ddcbe 100644 --- a/examples/network/http/httpwindow.h +++ b/examples/network/http/httpwindow.h @@ -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 &errors); #endif diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp index b49bda04ec..6aa3a5a5f4 100644 --- a/src/network/access/qhttpnetworkconnection.cpp +++ b/src/network/access/qhttpnetworkconnection.cpp @@ -57,7 +57,7 @@ #ifndef QT_NO_HTTP -#ifndef QT_NO_OPENSSL +#ifndef QT_NO_SSL # include # include # include @@ -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(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(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 &errors, int } } -#endif //QT_NO_OPENSSL +#endif //QT_NO_SSL #ifndef QT_NO_NETWORKPROXY // only called from QHttpNetworkConnectionChannel::_q_proxyAuthenticationRequired, not diff --git a/src/network/access/qhttpnetworkconnection_p.h b/src/network/access/qhttpnetworkconnection_p.h index 41ee11db51..1b9c703262 100644 --- a/src/network/access/qhttpnetworkconnection_p.h +++ b/src/network/access/qhttpnetworkconnection_p.h @@ -71,7 +71,7 @@ #ifndef QT_NO_HTTP -#ifndef QT_NO_OPENSSL +#ifndef QT_NO_SSL # include # include #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 &errors, int channel = -1); diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp index b6b37db242..e4ea62f093 100644 --- a/src/network/access/qhttpnetworkconnectionchannel.cpp +++ b/src/network/access/qhttpnetworkconnectionchannel.cpp @@ -48,7 +48,7 @@ #ifndef QT_NO_HTTP -#ifndef QT_NO_OPENSSL +#ifndef QT_NO_SSL # include # include # include @@ -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(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(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(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) diff --git a/src/network/access/qhttpnetworkconnectionchannel_p.h b/src/network/access/qhttpnetworkconnectionchannel_p.h index 1198ec9941..7da9b514d6 100644 --- a/src/network/access/qhttpnetworkconnectionchannel_p.h +++ b/src/network/access/qhttpnetworkconnectionchannel_p.h @@ -69,7 +69,7 @@ #ifndef QT_NO_HTTP -#ifndef QT_NO_OPENSSL +#ifndef QT_NO_SSL # include # include #else @@ -115,7 +115,7 @@ public: QAuthenticator proxyAuthenticator; bool authenticationCredentialsSent; bool proxyCredentialsSent; -#ifndef QT_NO_OPENSSL +#ifndef QT_NO_SSL bool ignoreAllSslErrors; QList 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 &errors); // ssl errors from the socket void _q_encryptedBytesWritten(qint64 bytes); // proceed sending diff --git a/src/network/access/qhttpnetworkreply.cpp b/src/network/access/qhttpnetworkreply.cpp index 8206cfaab7..85463ee210 100644 --- a/src/network/access/qhttpnetworkreply.cpp +++ b/src/network/access/qhttpnetworkreply.cpp @@ -46,7 +46,7 @@ #ifndef QT_NO_HTTP -#ifndef QT_NO_OPENSSL +#ifndef QT_NO_SSL # include # include # include @@ -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 &errors) } -#endif //QT_NO_OPENSSL +#endif //QT_NO_SSL QT_END_NAMESPACE diff --git a/src/network/access/qhttpnetworkreply_p.h b/src/network/access/qhttpnetworkreply_p.h index 97400d3b15..04e4569457 100644 --- a/src/network/access/qhttpnetworkreply_p.h +++ b/src/network/access/qhttpnetworkreply_p.h @@ -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(); diff --git a/src/network/access/qhttpthreaddelegate.cpp b/src/network/access/qhttpthreaddelegate.cpp index 3901635ca0..c8b4c51e23 100644 --- a/src/network/access/qhttpthreaddelegate.cpp +++ b/src/network/access/qhttpthreaddelegate.cpp @@ -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)), this, SLOT(sslErrorsSlot(QList))); #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 &errors) { emit sslConfigurationChanged(httpReply->sslConfiguration()); diff --git a/src/network/access/qhttpthreaddelegate_p.h b/src/network/access/qhttpthreaddelegate_p.h index 24affdd8de..036d5b94c6 100644 --- a/src/network/access/qhttpthreaddelegate_p.h +++ b/src/network/access/qhttpthreaddelegate_p.h @@ -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 &, bool *, QList *); 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 &errors); #endif diff --git a/src/network/access/qnetworkaccessbackend.cpp b/src/network/access/qnetworkaccessbackend.cpp index d7b6b78e22..f99869621f 100644 --- a/src/network/access/qnetworkaccessbackend.cpp +++ b/src/network/access/qnetworkaccessbackend.cpp @@ -342,7 +342,7 @@ void QNetworkAccessBackend::redirectionRequested(const QUrl &target) void QNetworkAccessBackend::sslErrors(const QList &errors) { -#ifndef QT_NO_OPENSSL +#ifndef QT_NO_SSL reply->sslErrors(errors); #else Q_UNUSED(errors); diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp index a5a73e6e95..740e54b833 100644 --- a/src/network/access/qnetworkaccessmanager.cpp +++ b/src/network/access/qnetworkaccessmanager.cpp @@ -353,7 +353,7 @@ QNetworkAccessManager::QNetworkAccessManager(QObject *parent) #ifndef QT_NO_NETWORKPROXY qRegisterMetaType("QNetworkProxy"); #endif -#ifndef QT_NO_OPENSSL +#ifndef QT_NO_SSL qRegisterMetaType >("QList"); qRegisterMetaType("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 &errors) { -#ifndef QT_NO_OPENSSL +#ifndef QT_NO_SSL Q_Q(QNetworkAccessManager); QNetworkReply *reply = qobject_cast(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)), SLOT(_q_replySslErrors(QList))); diff --git a/src/network/access/qnetworkaccessmanager.h b/src/network/access/qnetworkaccessmanager.h index fdbcf01dad..4d23fcbcdc 100644 --- a/src/network/access/qnetworkaccessmanager.h +++ b/src/network/access/qnetworkaccessmanager.h @@ -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 &errors); #endif diff --git a/src/network/access/qnetworkreply.cpp b/src/network/access/qnetworkreply.cpp index 123418dbcd..ac38f2efec 100644 --- a/src/network/access/qnetworkreply.cpp +++ b/src/network/access/qnetworkreply.cpp @@ -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 diff --git a/src/network/access/qnetworkreply.h b/src/network/access/qnetworkreply.h index 89ccc2fb92..b8d606c260 100644 --- a/src/network/access/qnetworkreply.h +++ b/src/network/access/qnetworkreply.h @@ -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 &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 &errors); #endif diff --git a/src/network/access/qnetworkreplyhttpimpl.cpp b/src/network/access/qnetworkreplyhttpimpl.cpp index 71bc03e8d0..a4413cda95 100644 --- a/src/network/access/qnetworkreplyhttpimpl.cpp +++ b/src/network/access/qnetworkreplyhttpimpl.cpp @@ -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,bool*,QList*)), q, SLOT(replySslErrors(const QList &, bool *, QList *)), 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 &list, bool *ignoreAll, QList *toBeIgnored) { diff --git a/src/network/access/qnetworkreplyhttpimpl_p.h b/src/network/access/qnetworkreplyhttpimpl_p.h index b0a8e59b94..6129d9f3b4 100644 --- a/src/network/access/qnetworkreplyhttpimpl_p.h +++ b/src/network/access/qnetworkreplyhttpimpl_p.h @@ -67,7 +67,7 @@ #include #include -#ifndef QT_NO_OPENSSL +#ifndef QT_NO_SSL #include #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 &, bool *, QList *)) 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 &errors); @@ -256,7 +256,7 @@ public: QSharedPointer pendingDownloadProgressEmissions; -#ifndef QT_NO_OPENSSL +#ifndef QT_NO_SSL QSslConfiguration sslConfiguration; bool pendingIgnoreAllSslErrors; QList 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 &, bool *, QList *); void replySslConfigurationChanged(const QSslConfiguration&); #endif diff --git a/src/network/access/qnetworkreplyimpl.cpp b/src/network/access/qnetworkreplyimpl.cpp index f97d98ec5a..c0b8acc581 100644 --- a/src/network/access/qnetworkreplyimpl.cpp +++ b/src/network/access/qnetworkreplyimpl.cpp @@ -819,7 +819,7 @@ void QNetworkReplyImplPrivate::redirectionRequested(const QUrl &target) void QNetworkReplyImplPrivate::sslErrors(const QList &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 &er if (d->backend) d->backend->ignoreSslErrors(errors); } -#endif // QT_NO_OPENSSL +#endif // QT_NO_SSL /*! \internal diff --git a/src/network/access/qnetworkreplyimpl_p.h b/src/network/access/qnetworkreplyimpl_p.h index 39c3b9ca2e..601e99f5fa 100644 --- a/src/network/access/qnetworkreplyimpl_p.h +++ b/src/network/access/qnetworkreplyimpl_p.h @@ -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); diff --git a/src/network/access/qnetworkrequest.cpp b/src/network/access/qnetworkrequest.cpp index ef81b6081d..f94337eaeb 100644 --- a/src/network/access/qnetworkrequest.cpp +++ b/src/network/access/qnetworkrequest.cpp @@ -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(); } ~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. diff --git a/src/network/access/qnetworkrequest.h b/src/network/access/qnetworkrequest.h index 1eb0fff045..7f51826d17 100644 --- a/src/network/access/qnetworkrequest.h +++ b/src/network/access/qnetworkrequest.h @@ -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 diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp index 2e54a2d3ca..75e99fe223 100644 --- a/src/network/socket/qabstractsocket.cpp +++ b/src/network/socket/qabstractsocket.cpp @@ -457,7 +457,7 @@ #include #include -#ifndef QT_NO_OPENSSL +#ifndef QT_NO_SSL #include #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(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(this)) diff --git a/src/network/ssl/qsslsocket.h b/src/network/ssl/qsslsocket.h index bdc9c4b4cf..aa16425e9a 100644 --- a/src/network/ssl/qsslsocket.h +++ b/src/network/ssl/qsslsocket.h @@ -220,7 +220,7 @@ private: QT_END_NAMESPACE -#ifndef QT_NO_OPENSSL +#ifndef QT_NO_SSL Q_DECLARE_METATYPE(QList) #endif diff --git a/tests/auto/network/access/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp b/tests/auto/network/access/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp index 94346f726d..f9f3b26898 100644 --- a/tests/auto/network/access/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp +++ b/tests/auto/network/access/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp @@ -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 &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 &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() { diff --git a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp index 279570b547..671d03cf84 100644 --- a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp @@ -67,7 +67,7 @@ #include #include #include -#ifndef QT_NO_OPENSSL +#ifndef QT_NO_SSL #include #include #endif @@ -93,7 +93,7 @@ Q_DECLARE_METATYPE(QNetworkReply::NetworkError) Q_DECLARE_METATYPE(QBuffer*) Q_DECLARE_METATYPE(QHttpMultiPart *) Q_DECLARE_METATYPE(QList) // 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 proxies; QNetworkAccessManager manager; MyCookieJar *cookieJar; -#ifndef QT_NO_OPENSSL +#ifndef QT_NO_SSL QSslConfiguration storedSslConfiguration; QList 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 &); void storeSslConfiguration(); void ignoreSslErrorListSlot(QNetworkReply *reply, const QList &); @@ -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& 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& errors) { qDebug() << "slotSslErrors" << sslSocket->errorString() << errors; @@ -1104,7 +1104,7 @@ tst_QNetworkReply::tst_QNetworkReply() qRegisterMetaType(); // for QSignalSpy qRegisterMetaType(); qRegisterMetaType(); -#ifndef QT_NO_OPENSSL +#ifndef QT_NO_SSL qRegisterMetaType >(); #endif qRegisterMetaType(); @@ -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 &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(); // 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)), SLOT(sslErrors(QNetworkReply*,QList))); #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)), this, SLOT(sslErrors(QNetworkReply*,QList))); #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("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("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("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)), SLOT(sslErrors(QNetworkReply*,QList))); #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)), SLOT(sslErrors(QNetworkReply*,QList))); #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, diff --git a/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp b/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp index abeb1ed06d..2c2b551257 100644 --- a/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp +++ b/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp @@ -68,7 +68,7 @@ #include #include #include -#ifndef QT_NO_OPENSSL +#ifndef QT_NO_SSL #include #endif #include @@ -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; diff --git a/tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp b/tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp index da2dd989c7..5da9ff0476 100644 --- a/tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp +++ b/tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp @@ -66,7 +66,7 @@ class tst_QSslCertificate : public QObject QMap 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" diff --git a/tests/auto/network/ssl/qsslcipher/tst_qsslcipher.cpp b/tests/auto/network/ssl/qsslcipher/tst_qsslcipher.cpp index 25d5f00e95..52f603d3c6 100644 --- a/tests/auto/network/ssl/qsslcipher/tst_qsslcipher.cpp +++ b/tests/auto/network/ssl/qsslcipher/tst_qsslcipher.cpp @@ -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" diff --git a/tests/auto/network/ssl/qsslerror/tst_qsslerror.cpp b/tests/auto/network/ssl/qsslerror/tst_qsslerror.cpp index e57c5fa7f4..bf5ae9c35b 100644 --- a/tests/auto/network/ssl/qsslerror/tst_qsslerror.cpp +++ b/tests/auto/network/ssl/qsslerror/tst_qsslerror.cpp @@ -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" diff --git a/tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp b/tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp index e8941a2642..ed3deb49ec 100644 --- a/tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp +++ b/tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp @@ -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() { diff --git a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp index 83060e27e4..cdb397ccd4 100644 --- a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp +++ b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp @@ -55,7 +55,7 @@ #include #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 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 { 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 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"); qRegisterMetaType("QSslError"); qRegisterMetaType("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) diff --git a/tests/auto/other/networkselftest/tst_networkselftest.cpp b/tests/auto/other/networkselftest/tst_networkselftest.cpp index 99d4ac9522..841df6e1f0 100644 --- a/tests/auto/other/networkselftest/tst_networkselftest.cpp +++ b/tests/auto/other/networkselftest/tst_networkselftest.cpp @@ -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(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) { -#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) 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() @@ -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"); diff --git a/tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp index 829bba5c5d..fe9efa55b7 100644 --- a/tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp @@ -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("ssl"); diff --git a/tests/manual/qnetworkreply/main.cpp b/tests/manual/qnetworkreply/main.cpp index 69bc0ef5be..1f2710e182 100644 --- a/tests/manual/qnetworkreply/main.cpp +++ b/tests/manual/qnetworkreply/main.cpp @@ -100,7 +100,7 @@ void tst_qnetworkreply::limiting_data() QTest::addColumn("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 -- cgit v1.2.3