summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
Diffstat (limited to 'src/network')
-rw-r--r--src/network/access/qhsts.cpp14
-rw-r--r--src/network/access/qhsts_p.h8
-rw-r--r--src/network/access/qhstspolicy.cpp34
-rw-r--r--src/network/access/qhstspolicy.h25
-rw-r--r--src/network/access/qhttpnetworkconnection.cpp8
-rw-r--r--src/network/access/qhttpnetworkrequest.cpp16
-rw-r--r--src/network/access/qhttpnetworkrequest_p.h6
-rw-r--r--src/network/access/qnetworkaccessmanager.cpp62
-rw-r--r--src/network/access/qnetworkaccessmanager.h14
-rw-r--r--src/network/access/qnetworkaccessmanager_p.h4
-rw-r--r--src/network/access/qnetworkreply.cpp2
-rw-r--r--src/network/access/qnetworkreplyhttpimpl.cpp14
-rw-r--r--src/network/access/qnetworkrequest.cpp48
-rw-r--r--src/network/access/qnetworkrequest.h14
-rw-r--r--src/network/configure.json34
-rw-r--r--src/network/doc/snippets/code/src_network_socket_qsctpsocket.cpp2
-rw-r--r--src/network/kernel/qnetworkdatagram.cpp2
-rw-r--r--src/network/kernel/qnetworkdatagram.h2
-rw-r--r--src/network/kernel/qnetworkdatagram_p.h32
-rw-r--r--src/network/socket/qnativesocketengine.cpp28
-rw-r--r--src/network/socket/qnativesocketengine_unix.cpp14
-rw-r--r--src/network/socket/qnativesocketengine_win.cpp14
-rw-r--r--src/network/ssl/qssldiffiehellmanparameters.cpp2
-rw-r--r--src/network/ssl/qssldiffiehellmanparameters.h2
-rw-r--r--src/network/ssl/qssldiffiehellmanparameters_dummy.cpp2
-rw-r--r--src/network/ssl/qssldiffiehellmanparameters_openssl.cpp2
-rw-r--r--src/network/ssl/qssldiffiehellmanparameters_p.h2
-rw-r--r--src/network/ssl/ssl.pri16
28 files changed, 226 insertions, 197 deletions
diff --git a/src/network/access/qhsts.cpp b/src/network/access/qhsts.cpp
index 5e4f75b0ed..3581fbc796 100644
--- a/src/network/access/qhsts.cpp
+++ b/src/network/access/qhsts.cpp
@@ -39,9 +39,9 @@
#include "qhsts_p.h"
-#include "QtCore/qstringlist.h"
-
#include "QtCore/private/qipaddress_p.h"
+#include "QtCore/qvector.h"
+#include "QtCore/qlist.h"
QT_BEGIN_NAMESPACE
@@ -84,7 +84,7 @@ void QHstsCache::updateFromHeaders(const QList<QPair<QByteArray, QByteArray>> &h
updateKnownHost(url.host(), parser.expirationDate(), parser.includeSubDomains());
}
-void QHstsCache::updateFromPolicies(const QList<QHstsPolicy> &policies)
+void QHstsCache::updateFromPolicies(const QVector<QHstsPolicy> &policies)
{
for (const auto &policy : policies)
updateKnownHost(policy.host(), policy.expiry(), policy.includesSubDomains());
@@ -183,9 +183,13 @@ void QHstsCache::clear()
knownHosts.clear();
}
-QList<QHstsPolicy> QHstsCache::policies() const
+QVector<QHstsPolicy> QHstsCache::policies() const
{
- return knownHosts.values();
+ QVector<QHstsPolicy> values;
+ values.reserve(knownHosts.size());
+ for (const auto &host : knownHosts)
+ values << host;
+ return values;
}
// The parser is quite simple: 'nextToken' knowns exactly what kind of tokens
diff --git a/src/network/access/qhsts_p.h b/src/network/access/qhsts_p.h
index 5d95f39b96..ab3ca536fb 100644
--- a/src/network/access/qhsts_p.h
+++ b/src/network/access/qhsts_p.h
@@ -57,26 +57,28 @@
#include <QtCore/qdatetime.h>
#include <QtCore/qstring.h>
#include <QtCore/qglobal.h>
-#include <QtCore/qlist.h>
#include <QtCore/qpair.h>
#include <QtCore/qurl.h>
#include <QtCore/qmap.h>
QT_BEGIN_NAMESPACE
+template<typename T> class QList;
+template <typename T> class QVector;
+
class Q_AUTOTEST_EXPORT QHstsCache
{
public:
void updateFromHeaders(const QList<QPair<QByteArray, QByteArray>> &headers,
const QUrl &url);
- void updateFromPolicies(const QList<QHstsPolicy> &hosts);
+ void updateFromPolicies(const QVector<QHstsPolicy> &hosts);
void updateKnownHost(const QUrl &url, const QDateTime &expires,
bool includeSubDomains);
bool isKnownHost(const QUrl &url) const;
void clear();
- QList<QHstsPolicy> policies() const;
+ QVector<QHstsPolicy> policies() const;
private:
diff --git a/src/network/access/qhstspolicy.cpp b/src/network/access/qhstspolicy.cpp
index 6922e1d8f9..634bf4784b 100644
--- a/src/network/access/qhstspolicy.cpp
+++ b/src/network/access/qhstspolicy.cpp
@@ -60,10 +60,10 @@ QT_BEGIN_NAMESPACE
applies to subdomains, either in the constructor or by calling setExpiry(),
setHost() and setIncludesSubdomains().
- \sa QNetworkAccessManager::enableStrictTransportSecurity()
+ \sa QNetworkAccessManager::setStrictTransportSecurityEnabled()
*/
-class QHstsPolicyPrivate
+class QHstsPolicyPrivate : public QSharedData
{
public:
QUrl url;
@@ -78,6 +78,15 @@ public:
};
/*!
+ Returns \c true if the two policies have the same host and expiration date
+ while agreeing on whether to include or exclude subdomains.
+*/
+bool operator==(const QHstsPolicy &lhs, const QHstsPolicy &rhs)
+{
+ return *lhs.d == *rhs.d;
+}
+
+/*!
Constructs an invalid (expired) policy with empty host name and subdomains
not included.
*/
@@ -121,17 +130,7 @@ QHstsPolicy::~QHstsPolicy()
*/
QHstsPolicy &QHstsPolicy::operator=(const QHstsPolicy &other)
{
- *d = *other.d;
- return *this;
-}
-
-
-/*!
- Move-assignment operator.
-*/
-QHstsPolicy &QHstsPolicy::operator=(QHstsPolicy &&other) Q_DECL_NOTHROW
-{
- qSwap(d, other.d);
+ d = other.d;
return *this;
}
@@ -196,15 +195,6 @@ bool QHstsPolicy::includesSubDomains() const
}
/*!
- Returns \c true if the two policies have the same host and expiration date
- while agreeing on whether to include or exclude subdomains.
-*/
-bool QHstsPolicy::operator==(const QHstsPolicy &other) const
-{
- return *d == *other.d;
-}
-
-/*!
Return \c true if this policy has a valid expiration date and this date
is greater than QDateTime::currentGetDateTimeUtc().
diff --git a/src/network/access/qhstspolicy.h b/src/network/access/qhstspolicy.h
index 4260ac278c..45fa40dfe8 100644
--- a/src/network/access/qhstspolicy.h
+++ b/src/network/access/qhstspolicy.h
@@ -42,7 +42,7 @@
#include <QtNetwork/qtnetworkglobal.h>
-#include <QtCore/qscopedpointer.h>
+#include <QtCore/qshareddata.h>
#include <QtCore/qurl.h>
QT_BEGIN_NAMESPACE
@@ -55,13 +55,15 @@ class Q_NETWORK_EXPORT QHstsPolicy
public:
QHstsPolicy();
- QHstsPolicy(const QDateTime &expiry, bool includeSubDomains, const QString &host,
- QUrl::ParsingMode mode = QUrl::DecodedMode);
+ explicit QHstsPolicy(const QDateTime &expiry, bool includeSubDomains, const QString &host,
+ QUrl::ParsingMode mode = QUrl::DecodedMode);
QHstsPolicy(const QHstsPolicy &rhs);
QHstsPolicy &operator=(const QHstsPolicy &rhs);
- QHstsPolicy &operator=(QHstsPolicy &&rhs) Q_DECL_NOTHROW;
+ QHstsPolicy &operator=(QHstsPolicy &&other) Q_DECL_NOTHROW { swap(other); return *this; }
~QHstsPolicy();
+ void swap(QHstsPolicy &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+
void setHost(const QString &host, QUrl::ParsingMode mode = QUrl::DecodedMode);
QString host(QUrl::ComponentFormattingOptions options = QUrl::FullyDecoded) const;
void setExpiry(const QDateTime &expiry);
@@ -69,14 +71,25 @@ public:
void setIncludesSubDomains(bool include);
bool includesSubDomains() const;
- bool operator==(const QHstsPolicy &rhs) const;
bool isExpired() const;
private:
- QScopedPointer<QHstsPolicyPrivate> d;
+ QSharedDataPointer<QHstsPolicyPrivate> d;
+
+ friend Q_NETWORK_EXPORT bool operator==(const QHstsPolicy &lhs, const QHstsPolicy &rhs);
};
+Q_DECLARE_SHARED(QHstsPolicy)
+
+Q_NETWORK_EXPORT bool operator==(const QHstsPolicy &lhs, const QHstsPolicy &rhs);
+
+inline bool operator!=(const QHstsPolicy &lhs, const QHstsPolicy &rhs)
+{
+ return !(lhs == rhs);
+}
+
+
QT_END_NAMESPACE
#endif // QHSTSPOLICY_H
diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp
index fd3cbbe36e..c2458152a3 100644
--- a/src/network/access/qhttpnetworkconnection.cpp
+++ b/src/network/access/qhttpnetworkconnection.cpp
@@ -550,15 +550,15 @@ QUrl QHttpNetworkConnectionPrivate::parseRedirectResponse(QAbstractSocket *socke
// Check redirect url protocol
const QUrl priorUrl(reply->request().url());
if (redirectUrl.scheme() == QLatin1String("http") || redirectUrl.scheme() == QLatin1String("https")) {
- switch (reply->request().redirectsPolicy()) {
- case QNetworkRequest::NoLessSafeRedirectsPolicy:
+ switch (reply->request().redirectPolicy()) {
+ case QNetworkRequest::NoLessSafeRedirectPolicy:
// Here we could handle https->http redirects as InsecureProtocolError.
// However, if HSTS is enabled and redirectUrl.host() is a known STS
// host, then we'll replace its scheme and this won't downgrade protocol,
// after all. We cannot access QNAM's STS cache from here, so delegate
// this check to QNetworkReplyHttpImpl.
break;
- case QNetworkRequest::SameOriginRedirectsPolicy:
+ case QNetworkRequest::SameOriginRedirectPolicy:
if (priorUrl.host() != redirectUrl.host()
|| priorUrl.scheme() != redirectUrl.scheme()
|| priorUrl.port() != redirectUrl.port()) {
@@ -566,7 +566,7 @@ QUrl QHttpNetworkConnectionPrivate::parseRedirectResponse(QAbstractSocket *socke
return QUrl();
}
break;
- case QNetworkRequest::UserVerifiedRedirectsPolicy:
+ case QNetworkRequest::UserVerifiedRedirectPolicy:
break;
default:
Q_ASSERT(!"Unexpected redirect policy");
diff --git a/src/network/access/qhttpnetworkrequest.cpp b/src/network/access/qhttpnetworkrequest.cpp
index 7862d464e1..60b566299f 100644
--- a/src/network/access/qhttpnetworkrequest.cpp
+++ b/src/network/access/qhttpnetworkrequest.cpp
@@ -49,7 +49,7 @@ QHttpNetworkRequestPrivate::QHttpNetworkRequestPrivate(QHttpNetworkRequest::Oper
: QHttpNetworkHeaderPrivate(newUrl), operation(op), priority(pri), uploadByteDevice(0),
autoDecompress(false), pipeliningAllowed(false), spdyAllowed(false), http2Allowed(false),
withCredentials(true), preConnect(false), redirectCount(0),
- redirectsPolicy(QNetworkRequest::ManualRedirectsPolicy)
+ redirectPolicy(QNetworkRequest::ManualRedirectPolicy)
{
}
@@ -67,7 +67,7 @@ QHttpNetworkRequestPrivate::QHttpNetworkRequestPrivate(const QHttpNetworkRequest
ssl(other.ssl),
preConnect(other.preConnect),
redirectCount(other.redirectCount),
- redirectsPolicy(other.redirectsPolicy)
+ redirectPolicy(other.redirectPolicy)
{
}
@@ -90,7 +90,7 @@ bool QHttpNetworkRequestPrivate::operator==(const QHttpNetworkRequestPrivate &ot
&& (withCredentials == other.withCredentials)
&& (ssl == other.ssl)
&& (preConnect == other.preConnect)
- && (redirectsPolicy == other.redirectsPolicy);
+ && (redirectPolicy == other.redirectPolicy);
}
QByteArray QHttpNetworkRequest::methodName() const
@@ -231,17 +231,17 @@ void QHttpNetworkRequest::setPreConnect(bool preConnect)
bool QHttpNetworkRequest::isFollowRedirects() const
{
- return d->redirectsPolicy != QNetworkRequest::ManualRedirectsPolicy;
+ return d->redirectPolicy != QNetworkRequest::ManualRedirectPolicy;
}
-void QHttpNetworkRequest::setRedirectsPolicy(QNetworkRequest::RedirectsPolicy policy)
+void QHttpNetworkRequest::setRedirectPolicy(QNetworkRequest::RedirectPolicy policy)
{
- d->redirectsPolicy = policy;
+ d->redirectPolicy = policy;
}
-QNetworkRequest::RedirectsPolicy QHttpNetworkRequest::redirectsPolicy() const
+QNetworkRequest::RedirectPolicy QHttpNetworkRequest::redirectPolicy() const
{
- return d->redirectsPolicy;
+ return d->redirectPolicy;
}
int QHttpNetworkRequest::redirectCount() const
diff --git a/src/network/access/qhttpnetworkrequest_p.h b/src/network/access/qhttpnetworkrequest_p.h
index 3900e9080e..ecf8856ded 100644
--- a/src/network/access/qhttpnetworkrequest_p.h
+++ b/src/network/access/qhttpnetworkrequest_p.h
@@ -131,8 +131,8 @@ public:
void setPreConnect(bool preConnect);
bool isFollowRedirects() const;
- void setRedirectsPolicy(QNetworkRequest::RedirectsPolicy policy);
- QNetworkRequest::RedirectsPolicy redirectsPolicy() const;
+ void setRedirectPolicy(QNetworkRequest::RedirectPolicy policy);
+ QNetworkRequest::RedirectPolicy redirectPolicy() const;
int redirectCount() const;
void setRedirectCount(int count);
@@ -176,7 +176,7 @@ public:
bool ssl;
bool preConnect;
int redirectCount;
- QNetworkRequest::RedirectsPolicy redirectsPolicy;
+ QNetworkRequest::RedirectPolicy redirectPolicy;
};
diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp
index 19e9ecc265..0a6270d417 100644
--- a/src/network/access/qnetworkaccessmanager.cpp
+++ b/src/network/access/qnetworkaccessmanager.cpp
@@ -697,36 +697,22 @@ void QNetworkAccessManager::setCookieJar(QNetworkCookieJar *cookieJar)
/*!
\since 5.9
- Enables HTTP Strict Transport Security (HSTS, RFC6797). When processing a
- request, QNetworkAccessManager automatically replaces "http" scheme with
- "https" and uses a secure transport if a host is a known HSTS host.
- Port 80 if it's set explicitly is replaced by port 443.
+ If \a enabled is \c true, QNetworkAccessManager follows the HTTP Strict Transport
+ Security policy (HSTS, RFC6797). When processing a request, QNetworkAccessManager
+ automatically replaces the "http" scheme with "https" and uses a secure transport
+ for HSTS hosts. If it's set explicitly, port 80 is replaced by port 443.
When HSTS is enabled, for each HTTP response containing HSTS header and
received over a secure transport, QNetworkAccessManager will update its HSTS
cache, either remembering a host with a valid policy or removing a host with
- expired/disabled HSTS policy.
+ an expired or disabled HSTS policy.
- \sa disableStrictTransportSecurity(), strictTransportSecurityEnabled()
+ \sa isStrictTransportSecurityEnabled()
*/
-void QNetworkAccessManager::enableStrictTransportSecurity()
+void QNetworkAccessManager::setStrictTransportSecurityEnabled(bool enabled)
{
Q_D(QNetworkAccessManager);
- d->stsEnabled = true;
-}
-
-/*!
- \since 5.9
-
- Disables HTTP Strict Transport Security (HSTS). HSTS headers in responses would
- be ignored, no scheme/port mapping is done.
-
- \sa enableStrictTransportSecurity()
-*/
-void QNetworkAccessManager::disableStrictTransportSecurity()
-{
- Q_D(QNetworkAccessManager);
- d->stsEnabled = false;
+ d->stsEnabled = enabled;
}
/*!
@@ -735,9 +721,9 @@ void QNetworkAccessManager::disableStrictTransportSecurity()
Returns true if HTTP Strict Transport Security (HSTS) was enabled. By default
HSTS is disabled.
- \sa enableStrictTransportSecurity
+ \sa setStrictTransportSecurityEnabled()
*/
-bool QNetworkAccessManager::strictTransportSecurityEnabled() const
+bool QNetworkAccessManager::isStrictTransportSecurityEnabled() const
{
Q_D(const QNetworkAccessManager);
return d->stsEnabled;
@@ -761,7 +747,7 @@ bool QNetworkAccessManager::strictTransportSecurityEnabled() const
\sa addStrictTransportSecurityHosts(), QHstsPolicy
*/
-void QNetworkAccessManager::addStrictTransportSecurityHosts(const QList<QHstsPolicy> &knownHosts)
+void QNetworkAccessManager::addStrictTransportSecurityHosts(const QVector<QHstsPolicy> &knownHosts)
{
Q_D(QNetworkAccessManager);
d->stsCache.updateFromPolicies(knownHosts);
@@ -776,7 +762,7 @@ void QNetworkAccessManager::addStrictTransportSecurityHosts(const QList<QHstsPol
\sa addStrictTransportSecurityHosts(), QHstsPolicy
*/
-QList<QHstsPolicy> QNetworkAccessManager::strictTransportSecurityHosts() const
+QVector<QHstsPolicy> QNetworkAccessManager::strictTransportSecurityHosts() const
{
Q_D(const QNetworkAccessManager);
return d->stsCache.policies();
@@ -1171,7 +1157,7 @@ void QNetworkAccessManager::connectToHost(const QString &hostName, quint16 port)
/*!
\since 5.9
- Sets the manager's redirects policy to be the \a policy specified. This policy
+ Sets the manager's redirect policy to be the \a policy specified. This policy
will affect all subsequent requests created by the manager.
Use this function to enable or disable HTTP redirects on the manager's level.
@@ -1180,18 +1166,18 @@ void QNetworkAccessManager::connectToHost(const QString &hostName, quint16 port)
the highest priority, next by priority is QNetworkRequest::FollowRedirectsAttribute.
Finally, the manager's policy has the lowest priority.
- For backwards compatibility the default value is QNetworkRequest::ManualRedirectsPolicy.
+ For backwards compatibility the default value is QNetworkRequest::ManualRedirectPolicy.
This may change in the future and some type of auto-redirect policy will become
the default; clients relying on manual redirect handling are encouraged to set
this policy explicitly in their code.
- \sa redirectsPolicy(), QNetworkRequest::RedirectsPolicy,
+ \sa redirectPolicy(), QNetworkRequest::RedirectPolicy,
QNetworkRequest::FollowRedirectsAttribute
*/
-void QNetworkAccessManager::setRedirectsPolicy(QNetworkRequest::RedirectsPolicy policy)
+void QNetworkAccessManager::setRedirectPolicy(QNetworkRequest::RedirectPolicy policy)
{
Q_D(QNetworkAccessManager);
- d->redirectsPolicy = policy;
+ d->redirectPolicy = policy;
}
/*!
@@ -1199,12 +1185,12 @@ void QNetworkAccessManager::setRedirectsPolicy(QNetworkRequest::RedirectsPolicy
Returns the redirect policy that is used when creating new requests.
- \sa setRedirectsPolicy(), QNetworkRequest::RedirectsPolicy
+ \sa setRedirectPolicy(), QNetworkRequest::RedirectPolicy
*/
-QNetworkRequest::RedirectsPolicy QNetworkAccessManager::redirectsPolicy() const
+QNetworkRequest::RedirectPolicy QNetworkAccessManager::redirectPolicy() const
{
Q_D(const QNetworkAccessManager);
- return d->redirectsPolicy;
+ return d->redirectPolicy;
}
/*!
@@ -1294,12 +1280,12 @@ QNetworkReply *QNetworkAccessManager::createRequest(QNetworkAccessManager::Opera
Q_D(QNetworkAccessManager);
QNetworkRequest req(originalReq);
- if (req.attribute(QNetworkRequest::RedirectsPolicyAttribute).isNull()
+ if (req.attribute(QNetworkRequest::RedirectPolicyAttribute).isNull()
&& req.attribute(QNetworkRequest::FollowRedirectsAttribute).isNull()) {
// We only apply the general manager's policy if:
- // - RedirectsPolicyAttribute is not set already on request and
+ // - RedirectPolicyAttribute is not set already on request and
// - no FollowRedirectsAttribute is set.
- req.setAttribute(QNetworkRequest::RedirectsPolicyAttribute, redirectsPolicy());
+ req.setAttribute(QNetworkRequest::RedirectPolicyAttribute, redirectPolicy());
}
bool isLocalFile = req.url().isLocalFile();
@@ -1390,7 +1376,7 @@ QNetworkReply *QNetworkAccessManager::createRequest(QNetworkAccessManager::Opera
#endif
) {
#ifndef QT_NO_SSL
- if (strictTransportSecurityEnabled() && d->stsCache.isKnownHost(request.url())) {
+ if (isStrictTransportSecurityEnabled() && d->stsCache.isKnownHost(request.url())) {
QUrl stsUrl(request.url());
// RFC6797, 8.3:
// The UA MUST replace the URI scheme with "https" [RFC2818],
diff --git a/src/network/access/qnetworkaccessmanager.h b/src/network/access/qnetworkaccessmanager.h
index 52769627f3..f035ac5b00 100644
--- a/src/network/access/qnetworkaccessmanager.h
+++ b/src/network/access/qnetworkaccessmanager.h
@@ -42,6 +42,7 @@
#include <QtNetwork/qtnetworkglobal.h>
#include <QtNetwork/qnetworkrequest.h>
+#include <QtCore/QVector>
#include <QtCore/QObject>
#ifndef QT_NO_SSL
#include <QtNetwork/QSslConfiguration>
@@ -121,11 +122,10 @@ public:
QNetworkCookieJar *cookieJar() const;
void setCookieJar(QNetworkCookieJar *cookieJar);
- void enableStrictTransportSecurity();
- void disableStrictTransportSecurity();
- bool strictTransportSecurityEnabled() const;
- void addStrictTransportSecurityHosts(const QList<QHstsPolicy> &knownHosts);
- QList<QHstsPolicy> strictTransportSecurityHosts() const;
+ void setStrictTransportSecurityEnabled(bool enabled);
+ bool isStrictTransportSecurityEnabled() const;
+ void addStrictTransportSecurityHosts(const QVector<QHstsPolicy> &knownHosts);
+ QVector<QHstsPolicy> strictTransportSecurityHosts() const;
QNetworkReply *head(const QNetworkRequest &request);
QNetworkReply *get(const QNetworkRequest &request);
@@ -155,8 +155,8 @@ public:
#endif
void connectToHost(const QString &hostName, quint16 port = 80);
- void setRedirectsPolicy(QNetworkRequest::RedirectsPolicy policy);
- QNetworkRequest::RedirectsPolicy redirectsPolicy() const;
+ void setRedirectPolicy(QNetworkRequest::RedirectPolicy policy);
+ QNetworkRequest::RedirectPolicy redirectPolicy() const;
Q_SIGNALS:
#ifndef QT_NO_NETWORKPROXY
diff --git a/src/network/access/qnetworkaccessmanager_p.h b/src/network/access/qnetworkaccessmanager_p.h
index cafc93871a..13a26a54f1 100644
--- a/src/network/access/qnetworkaccessmanager_p.h
+++ b/src/network/access/qnetworkaccessmanager_p.h
@@ -93,7 +93,7 @@ public:
#endif
cookieJarCreated(false),
defaultAccessControl(true),
- redirectsPolicy(QNetworkRequest::ManualRedirectsPolicy),
+ redirectPolicy(QNetworkRequest::ManualRedirectPolicy),
authenticationManager(QSharedPointer<QNetworkAccessAuthenticationManager>::create())
{
#ifndef QT_NO_BEARERMANAGEMENT
@@ -196,7 +196,7 @@ public:
bool cookieJarCreated;
bool defaultAccessControl;
- QNetworkRequest::RedirectsPolicy redirectsPolicy;
+ QNetworkRequest::RedirectPolicy redirectPolicy;
// The cache with authorization data:
QSharedPointer<QNetworkAccessAuthenticationManager> authenticationManager;
diff --git a/src/network/access/qnetworkreply.cpp b/src/network/access/qnetworkreply.cpp
index ca27e66791..79afd21a1a 100644
--- a/src/network/access/qnetworkreply.cpp
+++ b/src/network/access/qnetworkreply.cpp
@@ -736,7 +736,7 @@ void QNetworkReply::setSslConfiguration(const QSslConfiguration &config)
this function has no effect.
\sa sslConfiguration(), sslErrors(), QSslSocket::ignoreSslErrors(),
- QNetworkAccessManager::enableStrictTransportSecurity()
+ QNetworkAccessManager::setStrictTransportSecurityEnabled()
*/
void QNetworkReply::ignoreSslErrors(const QList<QSslError> &errors)
{
diff --git a/src/network/access/qnetworkreplyhttpimpl.cpp b/src/network/access/qnetworkreplyhttpimpl.cpp
index ece08acc6b..5cd0747e34 100644
--- a/src/network/access/qnetworkreplyhttpimpl.cpp
+++ b/src/network/access/qnetworkreplyhttpimpl.cpp
@@ -668,14 +668,14 @@ void QNetworkReplyHttpImplPrivate::postRequest(const QNetworkRequest &newHttpReq
}
#endif
- auto redirectsPolicy = QNetworkRequest::ManualRedirectsPolicy;
- const QVariant value = newHttpRequest.attribute(QNetworkRequest::RedirectsPolicyAttribute);
+ auto redirectPolicy = QNetworkRequest::ManualRedirectPolicy;
+ const QVariant value = newHttpRequest.attribute(QNetworkRequest::RedirectPolicyAttribute);
if (value.isValid())
- redirectsPolicy = value.value<QNetworkRequest::RedirectsPolicy>();
+ redirectPolicy = value.value<QNetworkRequest::RedirectPolicy>();
else if (newHttpRequest.attribute(QNetworkRequest::FollowRedirectsAttribute).toBool())
- redirectsPolicy = QNetworkRequest::NoLessSafeRedirectsPolicy;
+ redirectPolicy = QNetworkRequest::NoLessSafeRedirectPolicy;
- httpRequest.setRedirectsPolicy(redirectsPolicy);
+ httpRequest.setRedirectPolicy(redirectPolicy);
httpRequest.setPriority(convert(newHttpRequest.priority()));
@@ -1155,7 +1155,7 @@ void QNetworkReplyHttpImplPrivate::onRedirected(const QUrl &redirectUrl, int htt
const bool isLessSafe = schemeBefore == QLatin1String("https")
&& url.scheme() == QLatin1String("http");
- if (httpRequest.redirectsPolicy() == QNetworkRequest::NoLessSafeRedirectsPolicy
+ if (httpRequest.redirectPolicy() == QNetworkRequest::NoLessSafeRedirectPolicy
&& isLessSafe) {
error(QNetworkReply::InsecureRedirectError,
QCoreApplication::translate("QHttp", "Insecure redirect"));
@@ -1165,7 +1165,7 @@ void QNetworkReplyHttpImplPrivate::onRedirected(const QUrl &redirectUrl, int htt
redirectRequest = createRedirectRequest(originalRequest, url, maxRedirectsRemaining);
operation = getRedirectOperation(operation, httpStatus);
- if (httpRequest.redirectsPolicy() != QNetworkRequest::UserVerifiedRedirectsPolicy)
+ if (httpRequest.redirectPolicy() != QNetworkRequest::UserVerifiedRedirectPolicy)
followRedirect();
emit q->redirected(url);
diff --git a/src/network/access/qnetworkrequest.cpp b/src/network/access/qnetworkrequest.cpp
index 169695fa27..e95187de30 100644
--- a/src/network/access/qnetworkrequest.cpp
+++ b/src/network/access/qnetworkrequest.cpp
@@ -289,9 +289,9 @@ QT_BEGIN_NAMESPACE
marked to be decompressed automatically.
(This value was introduced in 5.9.)
- \value RedirectsPolicyAttribute
+ \value RedirectPolicyAttribute
Requests only, type: QMetaType::Int, should be one of the
- QNetworkRequest::RedirectsPolicy values (default: ManualRedirectsPolicy).
+ QNetworkRequest::RedirectPolicy values (default: ManualRedirectPolicy).
This attribute obsoletes FollowRedirectsAttribute.
(This value was introduced in 5.9.)
@@ -343,33 +343,33 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \enum QNetworkRequest::RedirectsPolicy
+ \enum QNetworkRequest::RedirectPolicy
\since 5.9
Indicates whether the Network Access API should automatically follow a
HTTP redirect response or not.
- \value ManualRedirectsPolicy Default value: not following any redirects.
-
- \value NoLessSafeRedirectsPolicy Only "http"->"http", "http" -> "https"
- or "https" -> "https" redirects are allowed.
- Equivalent to setting the old FollowRedirectsAttribute
- to true
-
- \value SameOriginRedirectsPolicy Require the same protocol, host and port.
- Note, http://example.com and http://example.com:80
- will fail with this policy (implicit/explicit ports
- are considered to be a mismatch).
-
- \value UserVerifiedRedirectsPolicy Client decides whether to follow each
- redirect by handling the redirected()
- signal, emitting redirectAllowed() on
- the QNetworkReply object to allow
- the redirect or aborting/finishing it to
- reject the redirect. This can be used,
- for example, to ask the user whether to
- accept the redirect, or to decide
- based on some app-specific configuration.
+ \value ManualRedirectPolicy Default value: not following any redirects.
+
+ \value NoLessSafeRedirectPolicy Only "http"->"http", "http" -> "https"
+ or "https" -> "https" redirects are allowed.
+ Equivalent to setting the old FollowRedirectsAttribute
+ to true
+
+ \value SameOriginRedirectPolicy Require the same protocol, host and port.
+ Note, http://example.com and http://example.com:80
+ will fail with this policy (implicit/explicit ports
+ are considered to be a mismatch).
+
+ \value UserVerifiedRedirectPolicy Client decides whether to follow each
+ redirect by handling the redirected()
+ signal, emitting redirectAllowed() on
+ the QNetworkReply object to allow
+ the redirect or aborting/finishing it to
+ reject the redirect. This can be used,
+ for example, to ask the user whether to
+ accept the redirect, or to decide
+ based on some app-specific configuration.
*/
class QNetworkRequestPrivate: public QSharedData, public QNetworkHeadersPrivate
diff --git a/src/network/access/qnetworkrequest.h b/src/network/access/qnetworkrequest.h
index 06c895af5f..68d4ae6d6b 100644
--- a/src/network/access/qnetworkrequest.h
+++ b/src/network/access/qnetworkrequest.h
@@ -91,7 +91,7 @@ public:
HTTP2AllowedAttribute,
HTTP2WasUsedAttribute,
OriginalContentLengthAttribute,
- RedirectsPolicyAttribute,
+ RedirectPolicyAttribute,
User = 1000,
UserMax = 32767
@@ -113,11 +113,11 @@ public:
LowPriority = 5
};
- enum RedirectsPolicy {
- ManualRedirectsPolicy,
- NoLessSafeRedirectsPolicy,
- SameOriginRedirectsPolicy,
- UserVerifiedRedirectsPolicy
+ enum RedirectPolicy {
+ ManualRedirectPolicy,
+ NoLessSafeRedirectPolicy,
+ SameOriginRedirectPolicy,
+ UserVerifiedRedirectPolicy
};
@@ -177,6 +177,6 @@ Q_DECLARE_SHARED(QNetworkRequest)
QT_END_NAMESPACE
Q_DECLARE_METATYPE(QNetworkRequest)
-Q_DECLARE_METATYPE(QNetworkRequest::RedirectsPolicy)
+Q_DECLARE_METATYPE(QNetworkRequest::RedirectPolicy)
#endif
diff --git a/src/network/configure.json b/src/network/configure.json
index 1e08aa7c49..7bd3f6164a 100644
--- a/src/network/configure.json
+++ b/src/network/configure.json
@@ -7,9 +7,6 @@
"commandline": {
"assignments": {
- "OPENSSL_LIBS": "openssl.libs",
- "OPENSSL_LIBS_DEBUG": "openssl.libs.debug",
- "OPENSSL_LIBS_RELEASE": "openssl.libs.release",
"OPENSSL_PATH": "openssl.prefix"
},
"options": {
@@ -46,13 +43,24 @@
"-lproxy"
]
},
+ "openssl_headers": {
+ "label": "OpenSSL Headers",
+ "export": "openssl",
+ "test": "unix/openssl",
+ "sources": [
+ {
+ "comment": "placeholder for OPENSSL_PATH",
+ "libs": ""
+ }
+ ]
+ },
"openssl": {
- "label": "OpenSSL Libraries",
- "export": "",
+ "label": "OpenSSL",
+ "test": "unix/openssl",
"sources": [
{ "type": "openssl" },
{
- "comment": "placeholder for OPENSSL_LIBS{,_{DEBUG,RELEASE}}",
+ "comment": "placeholder for OPENSSL_{PATH,LIBS{,_{DEBUG,RELEASE}}}",
"libs": "",
"builds": {
"debug": "",
@@ -92,11 +100,6 @@
"test": "unix/ipv6ifname",
"use": "network"
},
- "openssl": {
- "label": "OpenSSL",
- "type": "compile",
- "test": "unix/openssl"
- },
"sctp": {
"label": "SCTP support",
"type": "compile",
@@ -138,7 +141,7 @@
"enable": "input.openssl == 'yes' || input.openssl == 'linked' || input.openssl == 'runtime'",
"disable": "input.openssl == 'no' || input.ssl == 'no'",
"autoDetect": "!config.winrt",
- "condition": "!features.securetransport && tests.openssl",
+ "condition": "!features.securetransport && (features.openssl-linked || libs.openssl_headers)",
"output": [
"privateFeature",
{ "type": "publicQtConfig", "condition": "!features.openssl-linked" },
@@ -149,14 +152,9 @@
"label": " Qt directly linked to OpenSSL",
"enable": "input.openssl == 'linked'",
"disable": "input.openssl != 'linked'",
- "condition": "features.openssl && libs.openssl",
+ "condition": "!features.securetransport && libs.openssl",
"output": [
"privateFeature",
- { "type": "varAssign", "name": "OPENSSL_LIBS", "value": "libs.openssl.libs", "eval": "true" },
- { "type": "varAssign", "name": "OPENSSL_LIBS_DEBUG", "value": "libs.openssl.builds.debug.libs",
- "eval": "true", "condition": "config.win32" },
- { "type": "varAssign", "name": "OPENSSL_LIBS_RELEASE", "value": "libs.openssl.builds.release.libs",
- "eval": "true", "condition": "config.win32" },
{ "type": "define", "name": "QT_LINKED_OPENSSL" }
]
},
diff --git a/src/network/doc/snippets/code/src_network_socket_qsctpsocket.cpp b/src/network/doc/snippets/code/src_network_socket_qsctpsocket.cpp
index 3783a6f939..378022d655 100644
--- a/src/network/doc/snippets/code/src_network_socket_qsctpsocket.cpp
+++ b/src/network/doc/snippets/code/src_network_socket_qsctpsocket.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2016 Alex Trotsenko <alex1973tr@gmail.com>
-** Contact: http://www.qt.io/licensing/
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
diff --git a/src/network/kernel/qnetworkdatagram.cpp b/src/network/kernel/qnetworkdatagram.cpp
index 88ca763187..dd412b69d1 100644
--- a/src/network/kernel/qnetworkdatagram.cpp
+++ b/src/network/kernel/qnetworkdatagram.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2016 Intel Corporation.
-** Contact: http://www.qt.io/licensing/
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtNetwork module of the Qt Toolkit.
**
diff --git a/src/network/kernel/qnetworkdatagram.h b/src/network/kernel/qnetworkdatagram.h
index a20d69185a..fa994d6170 100644
--- a/src/network/kernel/qnetworkdatagram.h
+++ b/src/network/kernel/qnetworkdatagram.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2016 Intel Corporation.
-** Contact: http://www.qt.io/licensing/
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtNetwork module of the Qt Toolkit.
**
diff --git a/src/network/kernel/qnetworkdatagram_p.h b/src/network/kernel/qnetworkdatagram_p.h
index e55651a78b..5b5c037488 100644
--- a/src/network/kernel/qnetworkdatagram_p.h
+++ b/src/network/kernel/qnetworkdatagram_p.h
@@ -1,31 +1,37 @@
/****************************************************************************
**
** Copyright (C) 2015 Intel Corporation.
-** Contact: http://www.qt.io/licensing/
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtNetwork module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL21$
+** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 or version 3 as published by the Free
-** Software Foundation and appearing in the file LICENSE.LGPLv21 and
-** LICENSE.LGPLv3 included in the packaging of this file. Please review the
-** following information to ensure the GNU Lesser General Public License
-** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
-** As a special exception, The Qt Company gives you certain additional
-** rights. These rights are described in The Qt Company LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/network/socket/qnativesocketengine.cpp b/src/network/socket/qnativesocketengine.cpp
index b56d460b8c..cf3afe1845 100644
--- a/src/network/socket/qnativesocketengine.cpp
+++ b/src/network/socket/qnativesocketengine.cpp
@@ -358,17 +358,41 @@ bool QNativeSocketEnginePrivate::checkProxy(const QHostAddress &address)
#if !defined(QT_NO_NETWORKPROXY)
QObject *parent = q_func()->parent();
QNetworkProxy proxy;
+ QNetworkProxyQuery::QueryType queryType = QNetworkProxyQuery::TcpSocket;
if (QAbstractSocket *socket = qobject_cast<QAbstractSocket *>(parent)) {
proxy = socket->proxy();
+ switch (socket->socketType()) {
+ case QAbstractSocket::UdpSocket:
+ queryType = QNetworkProxyQuery::UdpSocket;
+ break;
+ case QAbstractSocket::SctpSocket:
+ queryType = QNetworkProxyQuery::SctpSocket;
+ break;
+ case QAbstractSocket::TcpSocket:
+ case QAbstractSocket::UnknownSocketType:
+ queryType = QNetworkProxyQuery::TcpSocket;
+ }
} else if (QTcpServer *server = qobject_cast<QTcpServer *>(parent)) {
proxy = server->proxy();
+ queryType = QNetworkProxyQuery::TcpServer;
+#ifndef QT_NO_SCTP
+ if (qobject_cast<QSctpServer *>(server))
+ queryType = QNetworkProxyQuery::SctpServer;
+#endif
} else {
// no parent -> no proxy
return true;
}
- if (proxy.type() == QNetworkProxy::DefaultProxy)
- proxy = QNetworkProxy::applicationProxy();
+ if (proxy.type() == QNetworkProxy::DefaultProxy) {
+ // This is similar to what we have in QNetworkProxy::applicationProxy,
+ // the only difference is that we provide the correct query type instead of
+ // always using TcpSocket unconditionally (this is the default type for
+ // QNetworkProxyQuery).
+ QNetworkProxyQuery query;
+ query.setQueryType(queryType);
+ proxy = QNetworkProxyFactory::systemProxyForQuery(query).constFirst();
+ }
if (proxy.type() != QNetworkProxy::DefaultProxy &&
proxy.type() != QNetworkProxy::NoProxy) {
diff --git a/src/network/socket/qnativesocketengine_unix.cpp b/src/network/socket/qnativesocketengine_unix.cpp
index c12ae9730f..1e69aebb54 100644
--- a/src/network/socket/qnativesocketengine_unix.cpp
+++ b/src/network/socket/qnativesocketengine_unix.cpp
@@ -678,10 +678,16 @@ static bool multicastMembershipHelper(QNativeSocketEnginePrivate *d,
if (interface.isValid()) {
const QList<QNetworkAddressEntry> addressEntries = interface.addressEntries();
- if (!addressEntries.isEmpty()) {
- QHostAddress firstIP = addressEntries.first().ip();
- mreq4.imr_interface.s_addr = htonl(firstIP.toIPv4Address());
- } else {
+ bool found = false;
+ for (const QNetworkAddressEntry &entry : addressEntries) {
+ const QHostAddress ip = entry.ip();
+ if (ip.protocol() == QAbstractSocket::IPv4Protocol) {
+ mreq4.imr_interface.s_addr = htonl(ip.toIPv4Address());
+ found = true;
+ break;
+ }
+ }
+ if (!found) {
d->setError(QAbstractSocket::NetworkError,
QNativeSocketEnginePrivate::NetworkUnreachableErrorString);
return false;
diff --git a/src/network/socket/qnativesocketengine_win.cpp b/src/network/socket/qnativesocketengine_win.cpp
index 9e43265e59..2088d3927e 100644
--- a/src/network/socket/qnativesocketengine_win.cpp
+++ b/src/network/socket/qnativesocketengine_win.cpp
@@ -953,10 +953,16 @@ static bool multicastMembershipHelper(QNativeSocketEnginePrivate *d,
if (iface.isValid()) {
const QList<QNetworkAddressEntry> addressEntries = iface.addressEntries();
- if (!addressEntries.isEmpty()) {
- QHostAddress firstIP = addressEntries.first().ip();
- mreq4.imr_interface.s_addr = htonl(firstIP.toIPv4Address());
- } else {
+ bool found = false;
+ for (const QNetworkAddressEntry &entry : addressEntries) {
+ const QHostAddress ip = entry.ip();
+ if (ip.protocol() == QAbstractSocket::IPv4Protocol) {
+ mreq4.imr_interface.s_addr = htonl(ip.toIPv4Address());
+ found = true;
+ break;
+ }
+ }
+ if (!found) {
d->setError(QAbstractSocket::NetworkError,
QNativeSocketEnginePrivate::NetworkUnreachableErrorString);
return false;
diff --git a/src/network/ssl/qssldiffiehellmanparameters.cpp b/src/network/ssl/qssldiffiehellmanparameters.cpp
index de7eab9a9e..cb6c474861 100644
--- a/src/network/ssl/qssldiffiehellmanparameters.cpp
+++ b/src/network/ssl/qssldiffiehellmanparameters.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2015 Mikkel Krautz <mikkel@krautz.dk>
-** Contact: http://www.qt.io/licensing/
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtNetwork module of the Qt Toolkit.
**
diff --git a/src/network/ssl/qssldiffiehellmanparameters.h b/src/network/ssl/qssldiffiehellmanparameters.h
index 4533ea4ed2..497d2bebfb 100644
--- a/src/network/ssl/qssldiffiehellmanparameters.h
+++ b/src/network/ssl/qssldiffiehellmanparameters.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2015 Mikkel Krautz <mikkel@krautz.dk>
-** Contact: http://www.qt.io/licensing/
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtNetwork module of the Qt Toolkit.
**
diff --git a/src/network/ssl/qssldiffiehellmanparameters_dummy.cpp b/src/network/ssl/qssldiffiehellmanparameters_dummy.cpp
index 220c017f4c..8fcf141f73 100644
--- a/src/network/ssl/qssldiffiehellmanparameters_dummy.cpp
+++ b/src/network/ssl/qssldiffiehellmanparameters_dummy.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2015 Mikkel Krautz <mikkel@krautz.dk>
-** Contact: http://www.qt.io/licensing/
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtNetwork module of the Qt Toolkit.
**
diff --git a/src/network/ssl/qssldiffiehellmanparameters_openssl.cpp b/src/network/ssl/qssldiffiehellmanparameters_openssl.cpp
index 949da1b7df..90687b05c5 100644
--- a/src/network/ssl/qssldiffiehellmanparameters_openssl.cpp
+++ b/src/network/ssl/qssldiffiehellmanparameters_openssl.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2015 Mikkel Krautz <mikkel@krautz.dk>
-** Contact: http://www.qt.io/licensing/
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtNetwork module of the Qt Toolkit.
**
diff --git a/src/network/ssl/qssldiffiehellmanparameters_p.h b/src/network/ssl/qssldiffiehellmanparameters_p.h
index 06ecf292ff..dd69895dae 100644
--- a/src/network/ssl/qssldiffiehellmanparameters_p.h
+++ b/src/network/ssl/qssldiffiehellmanparameters_p.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2015 Mikkel Krautz <mikkel@krautz.dk>
-** Contact: http://www.qt.io/licensing/
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtNetwork module of the Qt Toolkit.
**
diff --git a/src/network/ssl/ssl.pri b/src/network/ssl/ssl.pri
index 79351017a6..52ce2eeade 100644
--- a/src/network/ssl/ssl.pri
+++ b/src/network/ssl/ssl.pri
@@ -56,7 +56,7 @@ qtConfig(ssl) {
ssl/qsslellipticcurve_dummy.cpp
}
- qtConfig(openssl)|qtConfig(openssl-linked) {
+ qtConfig(openssl) {
HEADERS += ssl/qsslcontext_openssl_p.h \
ssl/qsslsocket_openssl_p.h \
ssl/qsslsocket_openssl_symbols_p.h
@@ -79,16 +79,10 @@ qtConfig(ssl) {
# - libs in <OPENSSL_DIR>\lib\VC\static
# - configure: -openssl -openssl-linked -I <OPENSSL_DIR>\include -L <OPENSSL_DIR>\lib\VC\static OPENSSL_LIBS="-lUser32 -lAdvapi32 -lGdi32" OPENSSL_LIBS_DEBUG="-lssleay32MDd -llibeay32MDd" OPENSSL_LIBS_RELEASE="-lssleay32MD -llibeay32MD"
- include($$OUT_PWD/qtnetwork-config.pri)
-
- CONFIG(debug, debug|release) {
- LIBS_PRIVATE += $$OPENSSL_LIBS_DEBUG
- } else {
- LIBS_PRIVATE += $$OPENSSL_LIBS_RELEASE
- }
-
- QMAKE_CXXFLAGS += $$OPENSSL_CFLAGS
- LIBS_PRIVATE += $$OPENSSL_LIBS
+ qtConfig(openssl-linked): \
+ QMAKE_USE_FOR_PRIVATE += openssl
+ else: \
+ QMAKE_USE_FOR_PRIVATE += openssl/nolink
win32: LIBS_PRIVATE += -lcrypt32
}
}