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:
Shane Kearns 2012-02-20 17:02:41 +00:00 committed by Qt by Nokia
parent 3fe79f23a9
commit 3f91cde588
35 changed files with 144 additions and 144 deletions

View File

@ -151,7 +151,7 @@ void DownloadManager::execute()
void DownloadManager::sslErrors(const QList<QSslError> &sslErrors) void DownloadManager::sslErrors(const QList<QSslError> &sslErrors)
{ {
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
foreach (const QSslError &error, sslErrors) foreach (const QSslError &error, sslErrors)
fprintf(stderr, "SSL error: %s\n", qPrintable(error.errorString())); fprintf(stderr, "SSL error: %s\n", qPrintable(error.errorString()));
#endif #endif

View File

@ -47,7 +47,7 @@
HttpWindow::HttpWindow(QWidget *parent) HttpWindow::HttpWindow(QWidget *parent)
: QDialog(parent) : QDialog(parent)
{ {
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
urlLineEdit = new QLineEdit("https://qt.nokia.com/"); urlLineEdit = new QLineEdit("https://qt.nokia.com/");
#else #else
urlLineEdit = new QLineEdit("http://qt.nokia.com/"); urlLineEdit = new QLineEdit("http://qt.nokia.com/");
@ -75,7 +75,7 @@ HttpWindow::HttpWindow(QWidget *parent)
connect(&qnam, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)), connect(&qnam, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)),
this, SLOT(slotAuthenticationRequired(QNetworkReply*,QAuthenticator*))); this, SLOT(slotAuthenticationRequired(QNetworkReply*,QAuthenticator*)));
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
connect(&qnam, SIGNAL(sslErrors(QNetworkReply*,QList<QSslError>)), connect(&qnam, SIGNAL(sslErrors(QNetworkReply*,QList<QSslError>)),
this, SLOT(sslErrors(QNetworkReply*,QList<QSslError>))); this, SLOT(sslErrors(QNetworkReply*,QList<QSslError>)));
#endif #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) void HttpWindow::sslErrors(QNetworkReply*,const QList<QSslError> &errors)
{ {
QString errorString; QString errorString;

View File

@ -76,7 +76,7 @@ private slots:
void updateDataReadProgress(qint64 bytesRead, qint64 totalBytes); void updateDataReadProgress(qint64 bytesRead, qint64 totalBytes);
void enableDownloadButton(); void enableDownloadButton();
void slotAuthenticationRequired(QNetworkReply*,QAuthenticator *); void slotAuthenticationRequired(QNetworkReply*,QAuthenticator *);
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
void sslErrors(QNetworkReply*,const QList<QSslError> &errors); void sslErrors(QNetworkReply*,const QList<QSslError> &errors);
#endif #endif

View File

@ -57,7 +57,7 @@
#ifndef QT_NO_HTTP #ifndef QT_NO_HTTP
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
# include <private/qsslsocket_p.h> # include <private/qsslsocket_p.h>
# include <QtNetwork/qsslkey.h> # include <QtNetwork/qsslkey.h>
# include <QtNetwork/qsslcipher.h> # include <QtNetwork/qsslcipher.h>
@ -135,7 +135,7 @@ void QHttpNetworkConnectionPrivate::pauseConnection()
// Disable all socket notifiers // Disable all socket notifiers
for (int i = 0; i < channelCount; i++) { for (int i = 0; i < channelCount; i++) {
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
if (encrypt) if (encrypt)
QSslSocketPrivate::pauseSocketNotifiers(static_cast<QSslSocket*>(channels[i].socket)); QSslSocketPrivate::pauseSocketNotifiers(static_cast<QSslSocket*>(channels[i].socket));
else else
@ -149,7 +149,7 @@ void QHttpNetworkConnectionPrivate::resumeConnection()
state = RunningState; state = RunningState;
// Enable all socket notifiers // Enable all socket notifiers
for (int i = 0; i < channelCount; i++) { for (int i = 0; i < channelCount; i++) {
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
if (encrypt) if (encrypt)
QSslSocketPrivate::resumeSocketNotifiers(static_cast<QSslSocket*>(channels[i].socket)); QSslSocketPrivate::resumeSocketNotifiers(static_cast<QSslSocket*>(channels[i].socket));
else else
@ -1181,7 +1181,7 @@ QNetworkProxy QHttpNetworkConnection::transparentProxy() const
// SSL support below // SSL support below
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
void QHttpNetworkConnection::setSslConfiguration(const QSslConfiguration &config) void QHttpNetworkConnection::setSslConfiguration(const QSslConfiguration &config)
{ {
Q_D(QHttpNetworkConnection); 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 #ifndef QT_NO_NETWORKPROXY
// only called from QHttpNetworkConnectionChannel::_q_proxyAuthenticationRequired, not // only called from QHttpNetworkConnectionChannel::_q_proxyAuthenticationRequired, not

View File

@ -71,7 +71,7 @@
#ifndef QT_NO_HTTP #ifndef QT_NO_HTTP
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
# include <QtNetwork/qsslsocket.h> # include <QtNetwork/qsslsocket.h>
# include <QtNetwork/qsslerror.h> # include <QtNetwork/qsslerror.h>
#else #else
@ -120,7 +120,7 @@ public:
QHttpNetworkConnectionChannel *channels() const; QHttpNetworkConnectionChannel *channels() const;
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
void setSslConfiguration(const QSslConfiguration &config); void setSslConfiguration(const QSslConfiguration &config);
void ignoreSslErrors(int channel = -1); void ignoreSslErrors(int channel = -1);
void ignoreSslErrors(const QList<QSslError> &errors, int channel = -1); void ignoreSslErrors(const QList<QSslError> &errors, int channel = -1);

View File

@ -48,7 +48,7 @@
#ifndef QT_NO_HTTP #ifndef QT_NO_HTTP
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
# include <QtNetwork/qsslkey.h> # include <QtNetwork/qsslkey.h>
# include <QtNetwork/qsslcipher.h> # include <QtNetwork/qsslcipher.h>
# include <QtNetwork/qsslconfiguration.h> # include <QtNetwork/qsslconfiguration.h>
@ -77,7 +77,7 @@ QHttpNetworkConnectionChannel::QHttpNetworkConnectionChannel()
, proxyAuthMethod(QAuthenticatorPrivate::None) , proxyAuthMethod(QAuthenticatorPrivate::None)
, authenticationCredentialsSent(false) , authenticationCredentialsSent(false)
, proxyCredentialsSent(false) , proxyCredentialsSent(false)
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
, ignoreAllSslErrors(false) , ignoreAllSslErrors(false)
#endif #endif
, pipeliningSupported(PipeliningSupportUnknown) , pipeliningSupported(PipeliningSupportUnknown)
@ -90,7 +90,7 @@ QHttpNetworkConnectionChannel::QHttpNetworkConnectionChannel()
void QHttpNetworkConnectionChannel::init() void QHttpNetworkConnectionChannel::init()
{ {
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
if (connection->d_func()->encrypt) if (connection->d_func()->encrypt)
socket = new QSslSocket; socket = new QSslSocket;
else else
@ -139,7 +139,7 @@ void QHttpNetworkConnectionChannel::init()
Qt::DirectConnection); Qt::DirectConnection);
#endif #endif
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
QSslSocket *sslSocket = qobject_cast<QSslSocket*>(socket); QSslSocket *sslSocket = qobject_cast<QSslSocket*>(socket);
if (sslSocket) { if (sslSocket) {
// won't be a sslSocket if encrypt is false // won't be a sslSocket if encrypt is false
@ -257,7 +257,7 @@ bool QHttpNetworkConnectionChannel::sendRequest()
const qint64 socketWriteMaxSize = 16*1024; const qint64 socketWriteMaxSize = 16*1024;
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
QSslSocket *sslSocket = qobject_cast<QSslSocket*>(socket); QSslSocket *sslSocket = qobject_cast<QSslSocket*>(socket);
// if it is really an ssl socket, check more than just bytesToWrite() // if it is really an ssl socket, check more than just bytesToWrite()
while ((socket->bytesToWrite() + (sslSocket ? sslSocket->encryptedBytesToWrite() : 0)) while ((socket->bytesToWrite() + (sslSocket ? sslSocket->encryptedBytesToWrite() : 0))
@ -598,7 +598,7 @@ bool QHttpNetworkConnectionChannel::ensureConnection()
} }
#endif #endif
if (ssl) { if (ssl) {
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
QSslSocket *sslSocket = qobject_cast<QSslSocket*>(socket); QSslSocket *sslSocket = qobject_cast<QSslSocket*>(socket);
sslSocket->connectToHostEncrypted(connectHost, connectPort, QIODevice::ReadWrite, networkLayerPreference); sslSocket->connectToHostEncrypted(connectHost, connectPort, QIODevice::ReadWrite, networkLayerPreference);
if (ignoreAllSslErrors) if (ignoreAllSslErrors)
@ -1117,7 +1117,7 @@ void QHttpNetworkConnectionChannel::_q_uploadDataReadyRead()
sendRequest(); sendRequest();
} }
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
void QHttpNetworkConnectionChannel::_q_encrypted() void QHttpNetworkConnectionChannel::_q_encrypted()
{ {
if (!socket) if (!socket)

View File

@ -69,7 +69,7 @@
#ifndef QT_NO_HTTP #ifndef QT_NO_HTTP
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
# include <QtNetwork/qsslsocket.h> # include <QtNetwork/qsslsocket.h>
# include <QtNetwork/qsslerror.h> # include <QtNetwork/qsslerror.h>
#else #else
@ -115,7 +115,7 @@ public:
QAuthenticator proxyAuthenticator; QAuthenticator proxyAuthenticator;
bool authenticationCredentialsSent; bool authenticationCredentialsSent;
bool proxyCredentialsSent; bool proxyCredentialsSent;
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
bool ignoreAllSslErrors; bool ignoreAllSslErrors;
QList<QSslError> ignoreSslErrorsList; QList<QSslError> ignoreSslErrorsList;
#endif #endif
@ -177,7 +177,7 @@ public:
void _q_uploadDataReadyRead(); void _q_uploadDataReadyRead();
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
void _q_encrypted(); // start sending request (https) void _q_encrypted(); // start sending request (https)
void _q_sslErrors(const QList<QSslError> &errors); // ssl errors from the socket void _q_sslErrors(const QList<QSslError> &errors); // ssl errors from the socket
void _q_encryptedBytesWritten(qint64 bytes); // proceed sending void _q_encryptedBytesWritten(qint64 bytes); // proceed sending

View File

@ -46,7 +46,7 @@
#ifndef QT_NO_HTTP #ifndef QT_NO_HTTP
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
# include <QtNetwork/qsslkey.h> # include <QtNetwork/qsslkey.h>
# include <QtNetwork/qsslcipher.h> # include <QtNetwork/qsslcipher.h>
# include <QtNetwork/qsslconfiguration.h> # include <QtNetwork/qsslconfiguration.h>
@ -834,7 +834,7 @@ void QHttpNetworkReplyPrivate::eraseData()
// SSL support below // SSL support below
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
QSslConfiguration QHttpNetworkReply::sslConfiguration() const 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 QT_END_NAMESPACE

View File

@ -132,7 +132,7 @@ public:
QHttpNetworkConnection* connection(); QHttpNetworkConnection* connection();
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
QSslConfiguration sslConfiguration() const; QSslConfiguration sslConfiguration() const;
void setSslConfiguration(const QSslConfiguration &config); void setSslConfiguration(const QSslConfiguration &config);
void ignoreSslErrors(); void ignoreSslErrors();

View File

@ -270,7 +270,7 @@ void QHttpThreadDelegate::startRequest()
#else #else
httpConnection = new QNetworkAccessCachedHttpConnection(urlCopy.host(), urlCopy.port(), ssl, networkSession); httpConnection = new QNetworkAccessCachedHttpConnection(urlCopy.host(), urlCopy.port(), ssl, networkSession);
#endif #endif
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
// Set the QSslConfiguration from this QNetworkRequest. // Set the QSslConfiguration from this QNetworkRequest.
if (ssl && incomingSslConfiguration != QSslConfiguration::defaultConfiguration()) { if (ssl && incomingSslConfiguration != QSslConfiguration::defaultConfiguration()) {
httpConnection->setSslConfiguration(incomingSslConfiguration); httpConnection->setSslConfiguration(incomingSslConfiguration);
@ -312,7 +312,7 @@ void QHttpThreadDelegate::startRequest()
// some signals are only interesting when normal asynchronous style is used // some signals are only interesting when normal asynchronous style is used
connect(httpReply,SIGNAL(readyRead()), this, SLOT(readyReadSlot())); connect(httpReply,SIGNAL(readyRead()), this, SLOT(readyReadSlot()));
connect(httpReply,SIGNAL(dataReadProgress(qint64, qint64)), this, SLOT(dataReadProgressSlot(qint64,qint64))); 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>))); connect(httpReply,SIGNAL(sslErrors(const QList<QSslError>)), this, SLOT(sslErrorsSlot(QList<QSslError>)));
#endif #endif
@ -377,7 +377,7 @@ void QHttpThreadDelegate::finishedSlot()
emit downloadData(httpReply->readAny()); emit downloadData(httpReply->readAny());
} }
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
if (ssl) if (ssl)
emit sslConfigurationChanged(httpReply->sslConfiguration()); emit sslConfigurationChanged(httpReply->sslConfiguration());
#endif #endif
@ -427,7 +427,7 @@ void QHttpThreadDelegate::finishedWithErrorSlot(QNetworkReply::NetworkError erro
qDebug() << "QHttpThreadDelegate::finishedWithErrorSlot() thread=" << QThread::currentThreadId() << "error=" << errorCode << detail; qDebug() << "QHttpThreadDelegate::finishedWithErrorSlot() thread=" << QThread::currentThreadId() << "error=" << errorCode << detail;
#endif #endif
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
if (ssl) if (ssl)
emit sslConfigurationChanged(httpReply->sslConfiguration()); emit sslConfigurationChanged(httpReply->sslConfiguration());
#endif #endif
@ -465,7 +465,7 @@ void QHttpThreadDelegate::headerChangedSlot()
qDebug() << "QHttpThreadDelegate::headerChangedSlot() thread=" << QThread::currentThreadId(); qDebug() << "QHttpThreadDelegate::headerChangedSlot() thread=" << QThread::currentThreadId();
#endif #endif
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
if (ssl) if (ssl)
emit sslConfigurationChanged(httpReply->sslConfiguration()); emit sslConfigurationChanged(httpReply->sslConfiguration());
#endif #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) void QHttpThreadDelegate::sslErrorsSlot(const QList<QSslError> &errors)
{ {
emit sslConfigurationChanged(httpReply->sslConfiguration()); emit sslConfigurationChanged(httpReply->sslConfiguration());

View File

@ -88,7 +88,7 @@ public:
// incoming // incoming
bool ssl; bool ssl;
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
QSslConfiguration incomingSslConfiguration; QSslConfiguration incomingSslConfiguration;
#endif #endif
QHttpNetworkRequest httpRequest; QHttpNetworkRequest httpRequest;
@ -132,7 +132,7 @@ signals:
#ifndef QT_NO_NETWORKPROXY #ifndef QT_NO_NETWORKPROXY
void proxyAuthenticationRequired(const QNetworkProxy &, QAuthenticator *); void proxyAuthenticationRequired(const QNetworkProxy &, QAuthenticator *);
#endif #endif
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
void sslErrors(const QList<QSslError> &, bool *, QList<QSslError> *); void sslErrors(const QList<QSslError> &, bool *, QList<QSslError> *);
void sslConfigurationChanged(const QSslConfiguration); void sslConfigurationChanged(const QSslConfiguration);
#endif #endif
@ -158,7 +158,7 @@ protected slots:
void synchronousHeaderChangedSlot(); void synchronousHeaderChangedSlot();
void dataReadProgressSlot(qint64 done, qint64 total); void dataReadProgressSlot(qint64 done, qint64 total);
void cacheCredentialsSlot(const QHttpNetworkRequest &request, QAuthenticator *authenticator); void cacheCredentialsSlot(const QHttpNetworkRequest &request, QAuthenticator *authenticator);
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
void sslErrorsSlot(const QList<QSslError> &errors); void sslErrorsSlot(const QList<QSslError> &errors);
#endif #endif

View File

@ -342,7 +342,7 @@ void QNetworkAccessBackend::redirectionRequested(const QUrl &target)
void QNetworkAccessBackend::sslErrors(const QList<QSslError> &errors) void QNetworkAccessBackend::sslErrors(const QList<QSslError> &errors)
{ {
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
reply->sslErrors(errors); reply->sslErrors(errors);
#else #else
Q_UNUSED(errors); Q_UNUSED(errors);

View File

@ -353,7 +353,7 @@ QNetworkAccessManager::QNetworkAccessManager(QObject *parent)
#ifndef QT_NO_NETWORKPROXY #ifndef QT_NO_NETWORKPROXY
qRegisterMetaType<QNetworkProxy>("QNetworkProxy"); qRegisterMetaType<QNetworkProxy>("QNetworkProxy");
#endif #endif
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
qRegisterMetaType<QList<QSslError> >("QList<QSslError>"); qRegisterMetaType<QList<QSslError> >("QList<QSslError>");
qRegisterMetaType<QSslConfiguration>("QSslConfiguration"); qRegisterMetaType<QSslConfiguration>("QSslConfiguration");
#endif #endif
@ -1011,7 +1011,7 @@ QNetworkReply *QNetworkAccessManager::createRequest(QNetworkAccessManager::Opera
priv->backend->reply = priv; priv->backend->reply = priv;
} }
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
reply->setSslConfiguration(request.sslConfiguration()); reply->setSslConfiguration(request.sslConfiguration());
#endif #endif
@ -1051,7 +1051,7 @@ void QNetworkAccessManagerPrivate::_q_replyFinished()
void QNetworkAccessManagerPrivate::_q_replySslErrors(const QList<QSslError> &errors) void QNetworkAccessManagerPrivate::_q_replySslErrors(const QList<QSslError> &errors)
{ {
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
Q_Q(QNetworkAccessManager); Q_Q(QNetworkAccessManager);
QNetworkReply *reply = qobject_cast<QNetworkReply *>(q->sender()); QNetworkReply *reply = qobject_cast<QNetworkReply *>(q->sender());
if (reply) if (reply)
@ -1066,7 +1066,7 @@ QNetworkReply *QNetworkAccessManagerPrivate::postProcess(QNetworkReply *reply)
Q_Q(QNetworkAccessManager); Q_Q(QNetworkAccessManager);
QNetworkReplyPrivate::setManager(reply, q); QNetworkReplyPrivate::setManager(reply, q);
q->connect(reply, SIGNAL(finished()), SLOT(_q_replyFinished())); 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 /* In case we're compiled without SSL support, we don't have this signal and we need to
* avoid getting a connection error. */ * avoid getting a connection error. */
q->connect(reply, SIGNAL(sslErrors(QList<QSslError>)), SLOT(_q_replySslErrors(QList<QSslError>))); q->connect(reply, SIGNAL(sslErrors(QList<QSslError>)), SLOT(_q_replySslErrors(QList<QSslError>)));

View File

@ -140,7 +140,7 @@ Q_SIGNALS:
#endif #endif
void authenticationRequired(QNetworkReply *reply, QAuthenticator *authenticator); void authenticationRequired(QNetworkReply *reply, QAuthenticator *authenticator);
void finished(QNetworkReply *reply); void finished(QNetworkReply *reply);
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
void sslErrors(QNetworkReply *reply, const QList<QSslError> &errors); void sslErrors(QNetworkReply *reply, const QList<QSslError> &errors);
#endif #endif

View File

@ -573,7 +573,7 @@ QVariant QNetworkReply::attribute(QNetworkRequest::Attribute code) const
return d_func()->attributes.value(code); return d_func()->attributes.value(code);
} }
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
/*! /*!
Returns the SSL configuration and state associated with this Returns the SSL configuration and state associated with this
reply, if SSL was used. It will contain the remote server's reply, if SSL was used. It will contain the remote server's

View File

@ -134,7 +134,7 @@ public:
// attributes // attributes
QVariant attribute(QNetworkRequest::Attribute code) const; QVariant attribute(QNetworkRequest::Attribute code) const;
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
QSslConfiguration sslConfiguration() const; QSslConfiguration sslConfiguration() const;
void setSslConfiguration(const QSslConfiguration &configuration); void setSslConfiguration(const QSslConfiguration &configuration);
void ignoreSslErrors(const QList<QSslError> &errors); void ignoreSslErrors(const QList<QSslError> &errors);
@ -147,7 +147,7 @@ Q_SIGNALS:
void metaDataChanged(); void metaDataChanged();
void finished(); void finished();
void error(QNetworkReply::NetworkError); void error(QNetworkReply::NetworkError);
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
void sslErrors(const QList<QSslError> &errors); void sslErrors(const QList<QSslError> &errors);
#endif #endif

View File

@ -179,7 +179,7 @@ QNetworkReplyHttpImpl::QNetworkReplyHttpImpl(QNetworkAccessManager* const manage
d->operation = operation; d->operation = operation;
d->outgoingData = outgoingData; d->outgoingData = outgoingData;
d->url = request.url(); d->url = request.url();
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
d->sslConfiguration = request.sslConfiguration(); d->sslConfiguration = request.sslConfiguration();
#endif #endif
@ -387,7 +387,7 @@ bool QNetworkReplyHttpImpl::canReadLine () const
return d->downloadMultiBuffer.canReadLine(); return d->downloadMultiBuffer.canReadLine();
} }
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
void QNetworkReplyHttpImpl::ignoreSslErrors() void QNetworkReplyHttpImpl::ignoreSslErrors()
{ {
Q_D(QNetworkReplyHttpImpl); Q_D(QNetworkReplyHttpImpl);
@ -441,7 +441,7 @@ QNetworkReplyHttpImplPrivate::QNetworkReplyHttpImplPrivate()
, downloadZerocopyBuffer(0) , downloadZerocopyBuffer(0)
, pendingDownloadDataEmissions(new QAtomicInt()) , pendingDownloadDataEmissions(new QAtomicInt())
, pendingDownloadProgressEmissions(new QAtomicInt()) , pendingDownloadProgressEmissions(new QAtomicInt())
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
, pendingIgnoreAllSslErrors(false) , pendingIgnoreAllSslErrors(false)
#endif #endif
@ -764,7 +764,7 @@ void QNetworkReplyHttpImplPrivate::postRequest()
delegate->transparentProxy = transparentProxy; delegate->transparentProxy = transparentProxy;
#endif #endif
delegate->ssl = ssl; delegate->ssl = ssl;
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
if (ssl) if (ssl)
delegate->incomingSslConfiguration = request.sslConfiguration(); delegate->incomingSslConfiguration = request.sslConfiguration();
#endif #endif
@ -809,7 +809,7 @@ void QNetworkReplyHttpImplPrivate::postRequest()
QObject::connect(delegate, SIGNAL(error(QNetworkReply::NetworkError,QString)), QObject::connect(delegate, SIGNAL(error(QNetworkReply::NetworkError,QString)),
q, SLOT(httpError(QNetworkReply::NetworkError, const QString)), q, SLOT(httpError(QNetworkReply::NetworkError, const QString)),
Qt::QueuedConnection); Qt::QueuedConnection);
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
QObject::connect(delegate, SIGNAL(sslConfigurationChanged(QSslConfiguration)), QObject::connect(delegate, SIGNAL(sslConfigurationChanged(QSslConfiguration)),
q, SLOT(replySslConfigurationChanged(QSslConfiguration)), q, SLOT(replySslConfigurationChanged(QSslConfiguration)),
Qt::QueuedConnection); Qt::QueuedConnection);
@ -823,7 +823,7 @@ void QNetworkReplyHttpImplPrivate::postRequest()
q, SLOT(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)), q, SLOT(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)),
Qt::BlockingQueuedConnection); Qt::BlockingQueuedConnection);
#endif #endif
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
QObject::connect(delegate, SIGNAL(sslErrors(QList<QSslError>,bool*,QList<QSslError>*)), QObject::connect(delegate, SIGNAL(sslErrors(QList<QSslError>,bool*,QList<QSslError>*)),
q, SLOT(replySslErrors(const QList<QSslError> &, bool *, QList<QSslError> *)), q, SLOT(replySslErrors(const QList<QSslError> &, bool *, QList<QSslError> *)),
Qt::BlockingQueuedConnection); Qt::BlockingQueuedConnection);
@ -1202,7 +1202,7 @@ void QNetworkReplyHttpImplPrivate::httpError(QNetworkReply::NetworkError errorCo
error(errorCode, errorString); error(errorCode, errorString);
} }
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
void QNetworkReplyHttpImplPrivate::replySslErrors( void QNetworkReplyHttpImplPrivate::replySslErrors(
const QList<QSslError> &list, bool *ignoreAll, QList<QSslError> *toBeIgnored) const QList<QSslError> &list, bool *ignoreAll, QList<QSslError> *toBeIgnored)
{ {

View File

@ -67,7 +67,7 @@
#include <private/qnetworkreply_p.h> #include <private/qnetworkreply_p.h>
#include <QtNetwork/QNetworkProxy> #include <QtNetwork/QNetworkProxy>
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
#include <QtNetwork/QSslConfiguration> #include <QtNetwork/QSslConfiguration>
#endif #endif
@ -113,7 +113,7 @@ public:
Q_PRIVATE_SLOT(d_func(), void replyDownloadProgressSlot(qint64,qint64)) 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 httpAuthenticationRequired(const QHttpNetworkRequest &, QAuthenticator *))
Q_PRIVATE_SLOT(d_func(), void httpError(QNetworkReply::NetworkError, const QString &)) 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 replySslErrors(const QList<QSslError> &, bool *, QList<QSslError> *))
Q_PRIVATE_SLOT(d_func(), void replySslConfigurationChanged(const QSslConfiguration&)) Q_PRIVATE_SLOT(d_func(), void replySslConfigurationChanged(const QSslConfiguration&))
#endif #endif
@ -125,7 +125,7 @@ public:
Q_PRIVATE_SLOT(d_func(), void emitReplyUploadProgress(qint64, qint64)) Q_PRIVATE_SLOT(d_func(), void emitReplyUploadProgress(qint64, qint64))
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
protected: protected:
void ignoreSslErrors(); void ignoreSslErrors();
void ignoreSslErrorsImplementation(const QList<QSslError> &errors); void ignoreSslErrorsImplementation(const QList<QSslError> &errors);
@ -256,7 +256,7 @@ public:
QSharedPointer<QAtomicInt> pendingDownloadProgressEmissions; QSharedPointer<QAtomicInt> pendingDownloadProgressEmissions;
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
QSslConfiguration sslConfiguration; QSslConfiguration sslConfiguration;
bool pendingIgnoreAllSslErrors; bool pendingIgnoreAllSslErrors;
QList<QSslError> pendingIgnoreSslErrorsList; QList<QSslError> pendingIgnoreSslErrorsList;
@ -281,7 +281,7 @@ public:
void replyDownloadProgressSlot(qint64,qint64); void replyDownloadProgressSlot(qint64,qint64);
void httpAuthenticationRequired(const QHttpNetworkRequest &request, QAuthenticator *auth); void httpAuthenticationRequired(const QHttpNetworkRequest &request, QAuthenticator *auth);
void httpError(QNetworkReply::NetworkError error, const QString &errorString); 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 replySslErrors(const QList<QSslError> &, bool *, QList<QSslError> *);
void replySslConfigurationChanged(const QSslConfiguration&); void replySslConfigurationChanged(const QSslConfiguration&);
#endif #endif

View File

@ -819,7 +819,7 @@ void QNetworkReplyImplPrivate::redirectionRequested(const QUrl &target)
void QNetworkReplyImplPrivate::sslErrors(const QList<QSslError> &errors) void QNetworkReplyImplPrivate::sslErrors(const QList<QSslError> &errors)
{ {
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
Q_Q(QNetworkReplyImpl); Q_Q(QNetworkReplyImpl);
emit q->sslErrors(errors); emit q->sslErrors(errors);
#else #else
@ -930,7 +930,7 @@ void QNetworkReplyImpl::setReadBufferSize(qint64 size)
d->backend->setDownstreamLimited(d->readBufferMaxSize > 0); d->backend->setDownstreamLimited(d->readBufferMaxSize > 0);
} }
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
void QNetworkReplyImpl::sslConfigurationImplementation(QSslConfiguration &configuration) const void QNetworkReplyImpl::sslConfigurationImplementation(QSslConfiguration &configuration) const
{ {
Q_D(const QNetworkReplyImpl); Q_D(const QNetworkReplyImpl);
@ -958,7 +958,7 @@ void QNetworkReplyImpl::ignoreSslErrorsImplementation(const QList<QSslError> &er
if (d->backend) if (d->backend)
d->backend->ignoreSslErrors(errors); d->backend->ignoreSslErrors(errors);
} }
#endif // QT_NO_OPENSSL #endif // QT_NO_SSL
/*! /*!
\internal \internal

View File

@ -98,7 +98,7 @@ public:
Q_PRIVATE_SLOT(d_func(), void _q_networkSessionFailed()) Q_PRIVATE_SLOT(d_func(), void _q_networkSessionFailed())
#endif #endif
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
protected: protected:
void sslConfigurationImplementation(QSslConfiguration &configuration) const; void sslConfigurationImplementation(QSslConfiguration &configuration) const;
void setSslConfigurationImplementation(const QSslConfiguration &configuration); void setSslConfigurationImplementation(const QSslConfiguration &configuration);

View File

@ -289,13 +289,13 @@ class QNetworkRequestPrivate: public QSharedData, public QNetworkHeadersPrivate
public: public:
inline QNetworkRequestPrivate() inline QNetworkRequestPrivate()
: priority(QNetworkRequest::NormalPriority) : priority(QNetworkRequest::NormalPriority)
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
, sslConfiguration(0) , sslConfiguration(0)
#endif #endif
{ qRegisterMetaType<QNetworkRequest>(); } { qRegisterMetaType<QNetworkRequest>(); }
~QNetworkRequestPrivate() ~QNetworkRequestPrivate()
{ {
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
delete sslConfiguration; delete sslConfiguration;
#endif #endif
} }
@ -307,7 +307,7 @@ public:
url = other.url; url = other.url;
priority = other.priority; priority = other.priority;
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
sslConfiguration = 0; sslConfiguration = 0;
if (other.sslConfiguration) if (other.sslConfiguration)
sslConfiguration = new QSslConfiguration(*other.sslConfiguration); sslConfiguration = new QSslConfiguration(*other.sslConfiguration);
@ -325,7 +325,7 @@ public:
QUrl url; QUrl url;
QNetworkRequest::Priority priority; QNetworkRequest::Priority priority;
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
mutable QSslConfiguration *sslConfiguration; mutable QSslConfiguration *sslConfiguration;
#endif #endif
}; };
@ -526,7 +526,7 @@ void QNetworkRequest::setAttribute(Attribute code, const QVariant &value)
d->attributes.remove(code); d->attributes.remove(code);
} }
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
/*! /*!
Returns this network request's SSL configuration. By default, no Returns this network request's SSL configuration. By default, no
SSL settings are specified. SSL settings are specified.

View File

@ -134,7 +134,7 @@ public:
QVariant attribute(Attribute code, const QVariant &defaultValue = QVariant()) const; QVariant attribute(Attribute code, const QVariant &defaultValue = QVariant()) const;
void setAttribute(Attribute code, const QVariant &value); void setAttribute(Attribute code, const QVariant &value);
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
QSslConfiguration sslConfiguration() const; QSslConfiguration sslConfiguration() const;
void setSslConfiguration(const QSslConfiguration &configuration); void setSslConfiguration(const QSslConfiguration &configuration);
#endif #endif

View File

@ -457,7 +457,7 @@
#include <qelapsedtimer.h> #include <qelapsedtimer.h>
#include <qscopedvaluerollback.h> #include <qscopedvaluerollback.h>
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
#include <QtNetwork/qsslsocket.h> #include <QtNetwork/qsslsocket.h>
#endif #endif
@ -2244,7 +2244,7 @@ void QAbstractSocket::abort()
#endif #endif
if (d->state == UnconnectedState) if (d->state == UnconnectedState)
return; return;
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
if (QSslSocket *socket = qobject_cast<QSslSocket *>(this)) { if (QSslSocket *socket = qobject_cast<QSslSocket *>(this)) {
socket->abort(); socket->abort();
return; return;
@ -2303,7 +2303,7 @@ bool QAbstractSocket::atEnd() const
bool QAbstractSocket::flush() bool QAbstractSocket::flush()
{ {
Q_D(QAbstractSocket); Q_D(QAbstractSocket);
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
// Manual polymorphism; flush() isn't virtual, but QSslSocket overloads // Manual polymorphism; flush() isn't virtual, but QSslSocket overloads
// it. // it.
if (QSslSocket *socket = qobject_cast<QSslSocket *>(this)) if (QSslSocket *socket = qobject_cast<QSslSocket *>(this))

View File

@ -220,7 +220,7 @@ private:
QT_END_NAMESPACE QT_END_NAMESPACE
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
Q_DECLARE_METATYPE(QList<QSslError>) Q_DECLARE_METATYPE(QList<QSslError>)
#endif #endif

View File

@ -58,7 +58,7 @@ public Q_SLOTS:
void finishedReply(); void finishedReply();
void finishedWithError(QNetworkReply::NetworkError errorCode, const QString &detail); void finishedWithError(QNetworkReply::NetworkError errorCode, const QString &detail);
void challenge401(const QHttpNetworkRequest &request, QAuthenticator *authenticator); void challenge401(const QHttpNetworkRequest &request, QAuthenticator *authenticator);
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
void sslErrors(const QList<QSslError> &errors); void sslErrors(const QList<QSslError> &errors);
#endif #endif
private: private:
@ -92,11 +92,11 @@ private Q_SLOTS:
void compression_data(); void compression_data();
void compression(); void compression();
#endif #endif
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
void ignoresslerror_data(); void ignoresslerror_data();
void ignoresslerror(); void ignoresslerror();
#endif #endif
#ifdef QT_NO_OPENSSL #ifdef QT_NO_SSL
void nossl_data(); void nossl_data();
void nossl(); void nossl();
#endif #endif
@ -665,7 +665,7 @@ void tst_QHttpNetworkConnection::compression()
} }
#endif #endif
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
void tst_QHttpNetworkConnection::sslErrors(const QList<QSslError> &errors) void tst_QHttpNetworkConnection::sslErrors(const QList<QSslError> &errors)
{ {
Q_UNUSED(errors) Q_UNUSED(errors)
@ -745,7 +745,7 @@ void tst_QHttpNetworkConnection::ignoresslerror()
} }
#endif #endif
#ifdef QT_NO_OPENSSL #ifdef QT_NO_SSL
Q_DECLARE_METATYPE(QNetworkReply::NetworkError) Q_DECLARE_METATYPE(QNetworkReply::NetworkError)
void tst_QHttpNetworkConnection::nossl_data() void tst_QHttpNetworkConnection::nossl_data()
{ {

View File

@ -67,7 +67,7 @@
#include <QtNetwork/QHttpPart> #include <QtNetwork/QHttpPart>
#include <QtNetwork/QHttpMultiPart> #include <QtNetwork/QHttpMultiPart>
#include <QtNetwork/QNetworkProxyQuery> #include <QtNetwork/QNetworkProxyQuery>
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
#include <QtNetwork/qsslerror.h> #include <QtNetwork/qsslerror.h>
#include <QtNetwork/qsslconfiguration.h> #include <QtNetwork/qsslconfiguration.h>
#endif #endif
@ -93,7 +93,7 @@ Q_DECLARE_METATYPE(QNetworkReply::NetworkError)
Q_DECLARE_METATYPE(QBuffer*) Q_DECLARE_METATYPE(QBuffer*)
Q_DECLARE_METATYPE(QHttpMultiPart *) Q_DECLARE_METATYPE(QHttpMultiPart *)
Q_DECLARE_METATYPE(QList<QFile*>) // for multiparts Q_DECLARE_METATYPE(QList<QFile*>) // for multiparts
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
Q_DECLARE_METATYPE(QSslConfiguration) Q_DECLARE_METATYPE(QSslConfiguration)
#endif #endif
@ -143,7 +143,7 @@ class tst_QNetworkReply: public QObject
QList<ProxyData> proxies; QList<ProxyData> proxies;
QNetworkAccessManager manager; QNetworkAccessManager manager;
MyCookieJar *cookieJar; MyCookieJar *cookieJar;
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
QSslConfiguration storedSslConfiguration; QSslConfiguration storedSslConfiguration;
QList<QSslError> storedExpectedSslErrors; QList<QSslError> storedExpectedSslErrors;
#endif #endif
@ -172,7 +172,7 @@ public Q_SLOTS:
void proxyAuthenticationRequired(const QNetworkProxy &,QAuthenticator*); void proxyAuthenticationRequired(const QNetworkProxy &,QAuthenticator*);
void pipeliningHelperSlot(); void pipeliningHelperSlot();
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
void sslErrors(QNetworkReply*,const QList<QSslError> &); void sslErrors(QNetworkReply*,const QList<QSslError> &);
void storeSslConfiguration(); void storeSslConfiguration();
void ignoreSslErrorListSlot(QNetworkReply *reply, const QList<QSslError> &); void ignoreSslErrorListSlot(QNetworkReply *reply, const QList<QSslError> &);
@ -248,7 +248,7 @@ private Q_SLOTS:
void ioGetFromHttpWithProxyAuth(); void ioGetFromHttpWithProxyAuth();
void ioGetFromHttpWithProxyAuthSynchronous(); void ioGetFromHttpWithProxyAuthSynchronous();
void ioGetFromHttpWithSocksProxy(); void ioGetFromHttpWithSocksProxy();
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
void ioGetFromHttpsWithSslErrors(); void ioGetFromHttpsWithSslErrors();
void ioGetFromHttpsWithIgnoreSslErrors(); void ioGetFromHttpsWithIgnoreSslErrors();
void ioGetFromHttpsWithSslHandshakeError(); void ioGetFromHttpsWithSslHandshakeError();
@ -336,7 +336,7 @@ private Q_SLOTS:
void httpRecursiveCreation(); void httpRecursiveCreation();
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
void ioPostToHttpsUploadProgress(); void ioPostToHttpsUploadProgress();
void ignoreSslErrorsList_data(); void ignoreSslErrorsList_data();
void ignoreSslErrorsList(); void ignoreSslErrorsList();
@ -378,7 +378,7 @@ private Q_SLOTS:
void synchronousRequest_data(); void synchronousRequest_data();
void synchronousRequest(); void synchronousRequest();
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
void synchronousRequestSslFailure(); void synchronousRequestSslFailure();
#endif #endif
@ -450,7 +450,7 @@ QT_END_NAMESPACE
QFAIL(qPrintable(errorMsg)); \ QFAIL(qPrintable(errorMsg)); \
} while (0); } while (0);
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
static void setupSslServer(QSslSocket* serverSocket) static void setupSslServer(QSslSocket* serverSocket)
{ {
QString testDataDir = QFileInfo(QFINDTESTDATA("rfc3252.txt")).absolutePath(); QString testDataDir = QFileInfo(QFINDTESTDATA("rfc3252.txt")).absolutePath();
@ -504,7 +504,7 @@ protected:
client->setSocketDescriptor(socketDescriptor); client->setSocketDescriptor(socketDescriptor);
connectSocketSignals(); connectSocketSignals();
} else { } else {
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
QSslSocket *serverSocket = new QSslSocket; QSslSocket *serverSocket = new QSslSocket;
serverSocket->setParent(this); serverSocket->setParent(this);
if (serverSocket->setSocketDescriptor(socketDescriptor)) { if (serverSocket->setSocketDescriptor(socketDescriptor)) {
@ -541,7 +541,7 @@ private:
} }
private slots: private slots:
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
void slotSslErrors(const QList<QSslError>& errors) void slotSslErrors(const QList<QSslError>& errors)
{ {
qDebug() << "slotSslErrors" << client->errorString() << errors; qDebug() << "slotSslErrors" << client->errorString() << errors;
@ -820,7 +820,7 @@ public:
} }
virtual void incomingConnection(qintptr socketDescriptor) virtual void incomingConnection(qintptr socketDescriptor)
{ {
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
if (doSsl) { if (doSsl) {
QSslSocket *serverSocket = new QSslSocket; QSslSocket *serverSocket = new QSslSocket;
serverSocket->setParent(this); serverSocket->setParent(this);
@ -837,7 +837,7 @@ public:
} }
private slots: private slots:
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
void slotSslErrors(const QList<QSslError>& errors) void slotSslErrors(const QList<QSslError>& errors)
{ {
qDebug() << "slotSslErrors" << sslSocket->errorString() << errors; qDebug() << "slotSslErrors" << sslSocket->errorString() << errors;
@ -1104,7 +1104,7 @@ tst_QNetworkReply::tst_QNetworkReply()
qRegisterMetaType<QNetworkReply *>(); // for QSignalSpy qRegisterMetaType<QNetworkReply *>(); // for QSignalSpy
qRegisterMetaType<QAuthenticator *>(); qRegisterMetaType<QAuthenticator *>();
qRegisterMetaType<QNetworkProxy>(); qRegisterMetaType<QNetworkProxy>();
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
qRegisterMetaType<QList<QSslError> >(); qRegisterMetaType<QList<QSslError> >();
#endif #endif
qRegisterMetaType<QNetworkReply::NetworkError>(); qRegisterMetaType<QNetworkReply::NetworkError>();
@ -1150,7 +1150,7 @@ void tst_QNetworkReply::proxyAuthenticationRequired(const QNetworkProxy &, QAuth
auth->setPassword("password"); auth->setPassword("password");
} }
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
void tst_QNetworkReply::sslErrors(QNetworkReply *reply, const QList<QSslError> &errors) void tst_QNetworkReply::sslErrors(QNetworkReply *reply, const QList<QSslError> &errors)
{ {
reply->ignoreSslErrors(); reply->ignoreSslErrors();
@ -1345,7 +1345,7 @@ void tst_QNetworkReply::initTestCase()
#endif #endif
QDir::setSearchPaths("testdata", QStringList() << testDataDir); QDir::setSearchPaths("testdata", QStringList() << testDataDir);
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
QSslSocket::defaultCaCertificates(); //preload certificates QSslSocket::defaultCaCertificates(); //preload certificates
#endif #endif
#ifndef QT_NO_BEARERMANAGEMENT #ifndef QT_NO_BEARERMANAGEMENT
@ -3135,7 +3135,7 @@ void tst_QNetworkReply::ioGetFromHttpWithSocksProxy()
} }
} }
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
void tst_QNetworkReply::ioGetFromHttpsWithSslErrors() void tst_QNetworkReply::ioGetFromHttpsWithSslErrors()
{ {
qRegisterMetaType<QNetworkReply*>(); // for QSignalSpy qRegisterMetaType<QNetworkReply*>(); // for QSignalSpy
@ -3559,7 +3559,7 @@ void tst_QNetworkReply::ioGetWithManyProxies_data()
<< "ftp://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt" << "ftp://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt"
<< QNetworkReply::NoError; << QNetworkReply::NoError;
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
// HTTPS with HTTP transparent proxy // HTTPS with HTTP transparent proxy
proxyList.clear(); proxyList.clear();
proxyList << QNetworkProxy(QNetworkProxy::HttpProxy, QtNetworkSettings::serverName(), 3129); proxyList << QNetworkProxy(QNetworkProxy::HttpProxy, QtNetworkSettings::serverName(), 3129);
@ -3604,7 +3604,7 @@ void tst_QNetworkReply::ioGetWithManyProxies_data()
<< "ftp://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt" << "ftp://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt"
<< QNetworkReply::ProxyNotFoundError; << QNetworkReply::ProxyNotFoundError;
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
// HTTPS with HTTP caching proxy // HTTPS with HTTP caching proxy
proxyList.clear(); proxyList.clear();
proxyList << QNetworkProxy(QNetworkProxy::HttpCachingProxy, QtNetworkSettings::serverName(), 3129); proxyList << QNetworkProxy(QNetworkProxy::HttpCachingProxy, QtNetworkSettings::serverName(), 3129);
@ -3679,7 +3679,7 @@ void tst_QNetworkReply::ioGetWithManyProxies_data()
<< "ftp://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt" << "ftp://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt"
<< QNetworkReply::NoError; << QNetworkReply::NoError;
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
// HTTPS request with HTTP Caching + HTTP transparent // HTTPS request with HTTP Caching + HTTP transparent
proxyList.clear(); proxyList.clear();
proxyList << QNetworkProxy(QNetworkProxy::HttpCachingProxy, QtNetworkSettings::serverName(), 3129) proxyList << QNetworkProxy(QNetworkProxy::HttpCachingProxy, QtNetworkSettings::serverName(), 3129)
@ -3726,7 +3726,7 @@ void tst_QNetworkReply::ioGetWithManyProxies()
QSignalSpy authspy(&manager, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*))); QSignalSpy authspy(&manager, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)));
connect(&manager, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)), connect(&manager, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)),
SLOT(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*))); SLOT(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)));
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
connect(&manager, SIGNAL(sslErrors(QNetworkReply*,QList<QSslError>)), connect(&manager, SIGNAL(sslErrors(QNetworkReply*,QList<QSslError>)),
SLOT(sslErrors(QNetworkReply*,QList<QSslError>))); SLOT(sslErrors(QNetworkReply*,QList<QSslError>)));
#endif #endif
@ -3735,7 +3735,7 @@ void tst_QNetworkReply::ioGetWithManyProxies()
manager.disconnect(SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)), manager.disconnect(SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)),
this, SLOT(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*))); this, SLOT(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)));
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
manager.disconnect(SIGNAL(sslErrors(QNetworkReply*,QList<QSslError>)), manager.disconnect(SIGNAL(sslErrors(QNetworkReply*,QList<QSslError>)),
this, SLOT(sslErrors(QNetworkReply*,QList<QSslError>))); this, SLOT(sslErrors(QNetworkReply*,QList<QSslError>)));
#endif #endif
@ -4324,7 +4324,7 @@ void tst_QNetworkReply::ioPostToHttpNoBufferFlag()
QCOMPARE(reply->error(), QNetworkReply::ContentReSendError); QCOMPARE(reply->error(), QNetworkReply::ContentReSendError);
} }
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
class SslServer : public QTcpServer { class SslServer : public QTcpServer {
Q_OBJECT Q_OBJECT
public: public:
@ -4437,7 +4437,7 @@ void tst_QNetworkReply::ioGetFromBuiltinHttp_data()
QTest::addColumn<int>("bufferSize"); QTest::addColumn<int>("bufferSize");
QTest::newRow("http+unlimited") << false << 0; QTest::newRow("http+unlimited") << false << 0;
QTest::newRow("http+limited") << false << 4096; QTest::newRow("http+limited") << false << 4096;
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
QTest::newRow("https+unlimited") << true << 0; QTest::newRow("https+unlimited") << true << 0;
QTest::newRow("https+limited") << true << 4096; QTest::newRow("https+limited") << true << 4096;
#endif #endif
@ -5123,7 +5123,7 @@ void tst_QNetworkReply::httpProxyCommands_data()
<< QUrl("http://0.0.0.0:4443/http-request") << 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") << 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."; << "GET http://0.0.0.0:4443/http-request HTTP/1.";
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
QTest::newRow("https") QTest::newRow("https")
<< QUrl("https://0.0.0.0:4443/https-request") << QUrl("https://0.0.0.0:4443/https-request")
<< QByteArray("HTTP/1.0 200 Connection Established\r\n\r\n") << QByteArray("HTTP/1.0 200 Connection Established\r\n\r\n")
@ -5539,7 +5539,7 @@ void tst_QNetworkReply::httpRecursiveCreation()
QVERIFY(!QTestEventLoop::instance().timeout()); QVERIFY(!QTestEventLoop::instance().timeout());
} }
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
void tst_QNetworkReply::ignoreSslErrorsList_data() void tst_QNetworkReply::ignoreSslErrorsList_data()
{ {
QTest::addColumn<QString>("url"); QTest::addColumn<QString>("url");
@ -5637,7 +5637,7 @@ void tst_QNetworkReply::sslConfiguration()
QCOMPARE(reply->error(), expectedError); QCOMPARE(reply->error(), expectedError);
} }
#endif // QT_NO_OPENSSL #endif // QT_NO_SSL
void tst_QNetworkReply::getAndThenDeleteObject_data() void tst_QNetworkReply::getAndThenDeleteObject_data()
{ {
@ -6071,7 +6071,7 @@ void tst_QNetworkReply::authenticationCacheAfterCancel_data()
QTest::addColumn<QUrl>("url"); QTest::addColumn<QUrl>("url");
for (int i = 0; i < proxies.count(); ++i) { 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"); 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"); 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 #endif
} }
@ -6124,7 +6124,7 @@ void tst_QNetworkReply::authenticationCacheAfterCancel()
QFETCH(bool, proxyAuth); QFETCH(bool, proxyAuth);
QFETCH(QUrl, url); QFETCH(QUrl, url);
QNetworkAccessManager manager; QNetworkAccessManager manager;
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
connect(&manager, SIGNAL(sslErrors(QNetworkReply*,QList<QSslError>)), connect(&manager, SIGNAL(sslErrors(QNetworkReply*,QList<QSslError>)),
SLOT(sslErrors(QNetworkReply*,QList<QSslError>))); SLOT(sslErrors(QNetworkReply*,QList<QSslError>)));
#endif #endif
@ -6251,7 +6251,7 @@ void tst_QNetworkReply::authenticationWithDifferentRealm()
{ {
AuthenticationCacheHelper helper; AuthenticationCacheHelper helper;
QNetworkAccessManager manager; QNetworkAccessManager manager;
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
connect(&manager, SIGNAL(sslErrors(QNetworkReply*,QList<QSslError>)), connect(&manager, SIGNAL(sslErrors(QNetworkReply*,QList<QSslError>)),
SLOT(sslErrors(QNetworkReply*,QList<QSslError>))); SLOT(sslErrors(QNetworkReply*,QList<QSslError>)));
#endif #endif
@ -6436,7 +6436,7 @@ void tst_QNetworkReply::synchronousRequest_data()
// ### we would need to enflate (un-deflate) the file content and compare the sizes // ### we would need to enflate (un-deflate) the file content and compare the sizes
<< QString("text/plain"); << QString("text/plain");
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
QTest::newRow("https") QTest::newRow("https")
<< QUrl("https://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt") << QUrl("https://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt")
<< QString("file:" + testDataDir + "/rfc3252.txt") << QString("file:" + testDataDir + "/rfc3252.txt")
@ -6467,7 +6467,7 @@ void tst_QNetworkReply::synchronousRequest()
QNetworkRequest request(url); 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, // workaround for HTTPS requests: add self-signed server cert to list of CA certs,
// since we cannot react to the sslErrors() signal // since we cannot react to the sslErrors() signal
// to fix this properly we would need to have an ignoreSslErrors() method in the // to fix this properly we would need to have an ignoreSslErrors() method in the
@ -6512,7 +6512,7 @@ void tst_QNetworkReply::synchronousRequest()
reply->deleteLater(); reply->deleteLater();
} }
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
void tst_QNetworkReply::synchronousRequestSslFailure() void tst_QNetworkReply::synchronousRequestSslFailure()
{ {
// test that SSL won't be accepted with self-signed certificate, // test that SSL won't be accepted with self-signed certificate,

View File

@ -68,7 +68,7 @@
#include <QStringList> #include <QStringList>
#include <QTcpServer> #include <QTcpServer>
#include <QTcpSocket> #include <QTcpSocket>
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
#include <QSslSocket> #include <QSslSocket>
#endif #endif
#include <QTextStream> #include <QTextStream>
@ -332,7 +332,7 @@ void tst_QTcpSocket::initTestCase_data()
QTest::newRow("WithHttpProxyBasicAuth") << true << int(HttpProxy | AuthBasic) << false; QTest::newRow("WithHttpProxyBasicAuth") << true << int(HttpProxy | AuthBasic) << false;
// QTest::newRow("WithHttpProxyNtlmAuth") << true << int(HttpProxy | AuthNtlm) << 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("WithoutProxy SSL") << false << 0 << true;
QTest::newRow("WithSocks5Proxy SSL") << true << int(Socks5Proxy) << true; QTest::newRow("WithSocks5Proxy SSL") << true << int(Socks5Proxy) << true;
QTest::newRow("WithSocks5AuthProxy SSL") << true << int(Socks5Proxy | AuthBasic) << true; QTest::newRow("WithSocks5AuthProxy SSL") << true << int(Socks5Proxy | AuthBasic) << true;
@ -392,7 +392,7 @@ void tst_QTcpSocket::init()
QTcpSocket *tst_QTcpSocket::newSocket() const QTcpSocket *tst_QTcpSocket::newSocket() const
{ {
QTcpSocket *socket; QTcpSocket *socket;
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
QFETCH_GLOBAL(bool, ssl); QFETCH_GLOBAL(bool, ssl);
socket = ssl ? new QSslSocket : new QTcpSocket; socket = ssl ? new QSslSocket : new QTcpSocket;
#else #else
@ -1640,7 +1640,7 @@ public:
protected: protected:
inline void run() inline void run()
{ {
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
QFETCH_GLOBAL(bool, ssl); QFETCH_GLOBAL(bool, ssl);
if (ssl) if (ssl)
socket = new QSslSocket; socket = new QSslSocket;
@ -1924,7 +1924,7 @@ public:
attemptedToConnect = false; attemptedToConnect = false;
networkTimeout = false; networkTimeout = false;
count = 0; count = 0;
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
QFETCH_GLOBAL(bool, ssl); QFETCH_GLOBAL(bool, ssl);
if (ssl) if (ssl)
sock = new QSslSocket; sock = new QSslSocket;

View File

@ -66,7 +66,7 @@ class tst_QSslCertificate : public QObject
QMap<QString, QString> sha1Map; QMap<QString, QString> sha1Map;
void createTestRows(); void createTestRows();
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
void compareCertificates(const QSslCertificate & cert1, const QSslCertificate & cert2); void compareCertificates(const QSslCertificate & cert1, const QSslCertificate & cert2);
#endif #endif
@ -76,7 +76,7 @@ public slots:
void initTestCase(); void initTestCase();
void cleanupTestCase(); void cleanupTestCase();
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
private slots: private slots:
void emptyConstructor(); void emptyConstructor();
void constructor_data(); void constructor_data();
@ -173,7 +173,7 @@ static QByteArray readFile(const QString &absFilePath)
return file.readAll(); return file.readAll();
} }
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
void tst_QSslCertificate::emptyConstructor() void tst_QSslCertificate::emptyConstructor()
{ {
@ -1060,7 +1060,7 @@ void tst_QSslCertificate::extensions()
} }
#endif // QT_NO_OPENSSL #endif // QT_NO_SSL
QTEST_MAIN(tst_QSslCertificate) QTEST_MAIN(tst_QSslCertificate)
#include "tst_qsslcertificate.moc" #include "tst_qsslcertificate.moc"

View File

@ -59,7 +59,7 @@ public slots:
void init(); void init();
void cleanup(); void cleanup();
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
private slots: private slots:
void constructing(); void constructing();
@ -88,14 +88,14 @@ void tst_QSslCipher::cleanup()
{ {
} }
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
void tst_QSslCipher::constructing() void tst_QSslCipher::constructing()
{ {
QSslCipher cipher; QSslCipher cipher;
} }
#endif // QT_NO_OPENSSL #endif // QT_NO_SSL
QTEST_MAIN(tst_QSslCipher) QTEST_MAIN(tst_QSslCipher)
#include "tst_qsslcipher.moc" #include "tst_qsslcipher.moc"

View File

@ -77,7 +77,7 @@ public slots:
void init(); void init();
void cleanup(); void cleanup();
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
private slots: private slots:
void constructing(); void constructing();
#endif #endif
@ -109,14 +109,14 @@ void tst_QSslError::cleanup()
{ {
} }
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
void tst_QSslError::constructing() void tst_QSslError::constructing()
{ {
QSslError error; QSslError error;
} }
#endif // QT_NO_OPENSSL #endif // QT_NO_SSL
QTEST_MAIN(tst_QSslError) QTEST_MAIN(tst_QSslError)
#include "tst_qsslerror.moc" #include "tst_qsslerror.moc"

View File

@ -71,7 +71,7 @@ class tst_QSslKey : public QObject
public slots: public slots:
void initTestCase(); void initTestCase();
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
private slots: private slots:
void emptyConstructor(); void emptyConstructor();
@ -123,7 +123,7 @@ static QByteArray readFile(const QString &absFilePath)
return file.readAll(); return file.readAll();
} }
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
void tst_QSslKey::emptyConstructor() void tst_QSslKey::emptyConstructor()
{ {

View File

@ -55,7 +55,7 @@
#include <QAuthenticator> #include <QAuthenticator>
#include "private/qhostinfo_p.h" #include "private/qhostinfo_p.h"
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
#include "private/qsslsocket_openssl_p.h" #include "private/qsslsocket_openssl_p.h"
#include "private/qsslsocket_openssl_symbols_p.h" #include "private/qsslsocket_openssl_symbols_p.h"
#include "private/qsslconfiguration_p.h" #include "private/qsslconfiguration_p.h"
@ -65,7 +65,7 @@
Q_DECLARE_METATYPE(QAbstractSocket::SocketState) Q_DECLARE_METATYPE(QAbstractSocket::SocketState)
Q_DECLARE_METATYPE(QAbstractSocket::SocketError) Q_DECLARE_METATYPE(QAbstractSocket::SocketError)
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
Q_DECLARE_METATYPE(QSslSocket::SslMode) Q_DECLARE_METATYPE(QSslSocket::SslMode)
typedef QList<QSslError::SslError> SslErrorList; typedef QList<QSslError::SslError> SslErrorList;
Q_DECLARE_METATYPE(SslErrorList) Q_DECLARE_METATYPE(SslErrorList)
@ -80,7 +80,7 @@ Q_DECLARE_METATYPE(QSslConfiguration)
#define QSSLSOCKET_CERTUNTRUSTED_WORKAROUND #define QSSLSOCKET_CERTUNTRUSTED_WORKAROUND
#endif #endif
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
class QSslSocketPtr: public QSharedPointer<QSslSocket> class QSslSocketPtr: public QSharedPointer<QSslSocket>
{ {
public: public:
@ -113,7 +113,7 @@ public:
return QTestEventLoop::instance().timeout(); return QTestEventLoop::instance().timeout();
} }
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
QSslSocketPtr newSocket(); QSslSocketPtr newSocket();
#endif #endif
@ -124,7 +124,7 @@ public slots:
void cleanup(); void cleanup();
void proxyAuthenticationRequired(const QNetworkProxy &, QAuthenticator *auth); void proxyAuthenticationRequired(const QNetworkProxy &, QAuthenticator *auth);
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
private slots: private slots:
void constructing(); void constructing();
void simpleConnect(); void simpleConnect();
@ -226,7 +226,7 @@ protected slots:
private: private:
QSslSocket *socket; QSslSocket *socket;
QList<QSslError> storedExpectedSslErrors; QList<QSslError> storedExpectedSslErrors;
#endif // QT_NO_OPENSSL #endif // QT_NO_SSL
private: private:
static int loopLevel; static int loopLevel;
}; };
@ -235,7 +235,7 @@ int tst_QSslSocket::loopLevel = 0;
tst_QSslSocket::tst_QSslSocket() tst_QSslSocket::tst_QSslSocket()
{ {
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
qRegisterMetaType<QList<QSslError> >("QList<QSslError>"); qRegisterMetaType<QList<QSslError> >("QList<QSslError>");
qRegisterMetaType<QSslError>("QSslError"); qRegisterMetaType<QSslError>("QSslError");
qRegisterMetaType<QAbstractSocket::SocketState>("QAbstractSocket::SocketState"); qRegisterMetaType<QAbstractSocket::SocketState>("QAbstractSocket::SocketState");
@ -320,7 +320,7 @@ void tst_QSslSocket::cleanup()
QNetworkProxy::setApplicationProxy(QNetworkProxy::DefaultProxy); QNetworkProxy::setApplicationProxy(QNetworkProxy::DefaultProxy);
} }
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
QSslSocketPtr tst_QSslSocket::newSocket() QSslSocketPtr tst_QSslSocket::newSocket()
{ {
QSslSocket *socket = new QSslSocket; QSslSocket *socket = new QSslSocket;
@ -341,7 +341,7 @@ void tst_QSslSocket::proxyAuthenticationRequired(const QNetworkProxy &, QAuthent
auth->setPassword("password"); auth->setPassword("password");
} }
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
void tst_QSslSocket::constructing() void tst_QSslSocket::constructing()
{ {
@ -2216,7 +2216,7 @@ void tst_QSslSocket::setEmptyDefaultConfiguration() // this test should be last,
QVERIFY2(!socket->waitForEncrypted(4000), qPrintable(socket->errorString())); QVERIFY2(!socket->waitForEncrypted(4000), qPrintable(socket->errorString()));
} }
#endif // QT_NO_OPENSSL #endif // QT_NO_SSL
QTEST_MAIN(tst_QSslSocket) QTEST_MAIN(tst_QSslSocket)

View File

@ -80,7 +80,7 @@ private slots:
void httpServerFiles(); void httpServerFiles();
void httpServerCGI_data(); void httpServerCGI_data();
void httpServerCGI(); void httpServerCGI();
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
void httpsServer(); void httpsServer();
#endif #endif
void httpProxy(); void httpProxy();
@ -188,14 +188,14 @@ static bool doSocketRead(QTcpSocket *socket, int minBytesAvailable, int timeout
static bool doSocketFlush(QTcpSocket *socket, int timeout = 4000) static bool doSocketFlush(QTcpSocket *socket, int timeout = 4000)
{ {
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
QSslSocket *sslSocket = qobject_cast<QSslSocket *>(socket); QSslSocket *sslSocket = qobject_cast<QSslSocket *>(socket);
#endif #endif
QTime timer; QTime timer;
timer.start(); timer.start();
forever { forever {
if (socket->bytesToWrite() == 0 if (socket->bytesToWrite() == 0
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
&& sslSocket->encryptedBytesToWrite() == 0 && sslSocket->encryptedBytesToWrite() == 0
#endif #endif
) )
@ -210,7 +210,7 @@ static bool doSocketFlush(QTcpSocket *socket, int timeout = 4000)
static void netChat(int port, const QList<Chat> &chat) static void netChat(int port, const QList<Chat> &chat)
{ {
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
QSslSocket socket; QSslSocket socket;
#else #else
QTcpSocket socket; QTcpSocket socket;
@ -322,7 +322,7 @@ static void netChat(int port, const QList<Chat> &chat)
break; break;
case Chat::StartEncryption: case Chat::StartEncryption:
#ifdef QT_NO_OPENSSL #ifdef QT_NO_SSL
QFAIL("Internal error: SSL required for this test"); QFAIL("Internal error: SSL required for this test");
#else #else
qDebug() << i << "Starting client encryption"; qDebug() << i << "Starting client encryption";
@ -745,7 +745,7 @@ void tst_NetworkSelfTest::httpServerCGI()
netChat(80, chat); netChat(80, chat);
} }
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
void tst_NetworkSelfTest::httpsServer() void tst_NetworkSelfTest::httpsServer()
{ {
netChat(443, QList<Chat>() netChat(443, QList<Chat>()
@ -937,7 +937,7 @@ void tst_NetworkSelfTest::socks5ProxyAuth()
void tst_NetworkSelfTest::supportsSsl() void tst_NetworkSelfTest::supportsSsl()
{ {
#ifdef QT_NO_OPENSSL #ifdef QT_NO_SSL
QFAIL("SSL not compiled in"); QFAIL("SSL not compiled in");
#else #else
QVERIFY2(QSslSocket::supportsSsl(), "Could not load SSL libraries"); QVERIFY2(QSslSocket::supportsSsl(), "Could not load SSL libraries");

View File

@ -457,7 +457,7 @@ private slots:
void initTestCase(); void initTestCase();
void httpLatency(); void httpLatency();
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
void echoPerformance_data(); void echoPerformance_data();
void echoPerformance(); void echoPerformance();
#endif #endif
@ -491,7 +491,7 @@ void tst_qnetworkreply::httpLatency()
} }
} }
#ifndef QT_NO_OPENSSL #ifndef QT_NO_SSL
void tst_qnetworkreply::echoPerformance_data() void tst_qnetworkreply::echoPerformance_data()
{ {
QTest::addColumn<bool>("ssl"); QTest::addColumn<bool>("ssl");

View File

@ -100,7 +100,7 @@ void tst_qnetworkreply::limiting_data()
QTest::addColumn<QUrl>("url"); QTest::addColumn<QUrl>("url");
QTest::newRow("HTTP") << QUrl("http://" + QtNetworkSettings::serverName() + "/mediumfile"); 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"); QTest::newRow("HTTP+SSL") << QUrl("https://" + QtNetworkSettings::serverName() + "/mediumfile");
#endif #endif