summaryrefslogtreecommitdiffstats
path: root/src/network/ssl
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-09-26 16:08:55 +0200
committerLiang Qi <liang.qi@qt.io>2017-09-26 16:14:54 +0200
commitaadfe7d634de04519102c5827ca885dc2e2199c9 (patch)
treed92db346ca95332b177036a53f1f6beb2e24fb74 /src/network/ssl
parent4b6c1448047362b8c38d265e6414f0e3e59b8d37 (diff)
parenta732e16d5fd9dbf8a0289fec9f948b12e9ba2c19 (diff)
Merge remote-tracking branch 'origin/5.10' into dev
Conflicts: src/gui/kernel/qguiapplication.cpp src/platformsupport/input/libinput/qlibinputpointer.cpp src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.h src/plugins/platforms/cocoa/qcocoawindow.h src/testlib/qtestsystem.h Change-Id: I5975ffb3261c2dd82fe02ec4e57df7c0950226c5
Diffstat (limited to 'src/network/ssl')
-rw-r--r--src/network/ssl/qsslsocket.cpp12
-rw-r--r--src/network/ssl/qsslsocket.h1
-rw-r--r--src/network/ssl/qsslsocket_openssl.cpp5
-rw-r--r--src/network/ssl/qsslsocket_openssl_symbols.cpp18
-rw-r--r--src/network/ssl/qsslsocket_p.h1
5 files changed, 35 insertions, 2 deletions
diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp
index 9b62240767..5c9ebac283 100644
--- a/src/network/ssl/qsslsocket.cpp
+++ b/src/network/ssl/qsslsocket.cpp
@@ -2293,6 +2293,9 @@ void QSslSocketPrivate::createPlainSocket(QIODevice::OpenMode openMode)
q->connect(plainSocket, SIGNAL(channelBytesWritten(int, qint64)),
q, SLOT(_q_channelBytesWrittenSlot(int, qint64)),
Qt::DirectConnection);
+ q->connect(plainSocket, SIGNAL(readChannelFinished()),
+ q, SLOT(_q_readChannelFinishedSlot()),
+ Qt::DirectConnection);
#ifndef QT_NO_NETWORKPROXY
q->connect(plainSocket, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)),
q, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)));
@@ -2514,6 +2517,15 @@ void QSslSocketPrivate::_q_channelBytesWrittenSlot(int channel, qint64 written)
/*!
\internal
*/
+void QSslSocketPrivate::_q_readChannelFinishedSlot()
+{
+ Q_Q(QSslSocket);
+ emit q->readChannelFinished();
+}
+
+/*!
+ \internal
+*/
void QSslSocketPrivate::_q_flushWriteBuffer()
{
Q_Q(QSslSocket);
diff --git a/src/network/ssl/qsslsocket.h b/src/network/ssl/qsslsocket.h
index d76361029c..c66ebdde54 100644
--- a/src/network/ssl/qsslsocket.h
+++ b/src/network/ssl/qsslsocket.h
@@ -224,6 +224,7 @@ private:
Q_PRIVATE_SLOT(d_func(), void _q_channelReadyReadSlot(int))
Q_PRIVATE_SLOT(d_func(), void _q_bytesWrittenSlot(qint64))
Q_PRIVATE_SLOT(d_func(), void _q_channelBytesWrittenSlot(int, qint64))
+ Q_PRIVATE_SLOT(d_func(), void _q_readChannelFinishedSlot())
Q_PRIVATE_SLOT(d_func(), void _q_flushWriteBuffer())
Q_PRIVATE_SLOT(d_func(), void _q_flushReadBuffer())
Q_PRIVATE_SLOT(d_func(), void _q_resumeImplementation())
diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp
index 23a63ed063..2d771b5637 100644
--- a/src/network/ssl/qsslsocket_openssl.cpp
+++ b/src/network/ssl/qsslsocket_openssl.cpp
@@ -54,7 +54,6 @@
****************************************************************************/
//#define QSSLSOCKET_DEBUG
-//#define QT_DECRYPT_SSL_TRAFFIC
#include "qssl_p.h"
#include "qsslsocket_openssl_p.h"
@@ -213,6 +212,7 @@ int q_X509Callback(int ok, X509_STORE_CTX *ctx)
if (!ok) {
// Store the error and at which depth the error was detected.
_q_sslErrorList()->errors << QSslErrorEntry::fromStoreContext(ctx);
+#if !QT_CONFIG(opensslv11)
#ifdef QSSLSOCKET_DEBUG
qCDebug(lcSsl) << "verification error: dumping bad certificate";
qCDebug(lcSsl) << QSslCertificatePrivate::QSslCertificate_from_X509(q_X509_STORE_CTX_get_current_cert(ctx)).toPem();
@@ -233,7 +233,8 @@ int q_X509Callback(int ok, X509_STORE_CTX *ctx)
<< "ST=" << cert.subjectInfo(QSslCertificate::StateOrProvinceName);
qCDebug(lcSsl) << "Valid:" << cert.effectiveDate() << '-' << cert.expiryDate();
}
-#endif
+#endif // QSSLSOCKET_DEBUG
+#endif // !QT_CONFIG(opensslv11)
}
// Always return OK to allow verification to continue. We handle the
// errors gracefully after collecting all errors, after verification has
diff --git a/src/network/ssl/qsslsocket_openssl_symbols.cpp b/src/network/ssl/qsslsocket_openssl_symbols.cpp
index 0ef8bf6b5e..3a236a1300 100644
--- a/src/network/ssl/qsslsocket_openssl_symbols.cpp
+++ b/src/network/ssl/qsslsocket_openssl_symbols.cpp
@@ -699,6 +699,23 @@ static QPair<QSystemLibrary*, QSystemLibrary*> loadOpenSslWin32()
pair.first = 0;
pair.second = 0;
+#if QT_CONFIG(opensslv11)
+ // With OpenSSL 1.1 the names have changed to libssl-1_1(-x64) and libcrypto-1_1(-x64), for builds using
+ // MSVC and GCC, (-x64 suffix for 64-bit builds).
+
+#ifdef Q_PROCESSOR_X86_64
+#define QT_SSL_SUFFIX "-x64"
+#else // !Q_PROCESSOFR_X86_64
+#define QT_SSL_SUFFIX
+#endif // !Q_PROCESSOR_x86_64
+
+ tryToLoadOpenSslWin32Library(QLatin1String("libssl-1_1" QT_SSL_SUFFIX),
+ QLatin1String("libcrypto-1_1" QT_SSL_SUFFIX), pair);
+
+#undef QT_SSL_SUFFIX
+
+#else // QT_CONFIG(opensslv11)
+
// When OpenSSL is built using MSVC then the libraries are named 'ssleay32.dll' and 'libeay32'dll'.
// When OpenSSL is built using GCC then different library names are used (depending on the OpenSSL version)
// The oldest version of a GCC-based OpenSSL which can be detected by the code below is 0.9.8g (released in 2007)
@@ -709,6 +726,7 @@ static QPair<QSystemLibrary*, QSystemLibrary*> loadOpenSslWin32()
}
}
}
+#endif // !QT_CONFIG(opensslv11)
return pair;
}
diff --git a/src/network/ssl/qsslsocket_p.h b/src/network/ssl/qsslsocket_p.h
index a545c618ce..9d45d01695 100644
--- a/src/network/ssl/qsslsocket_p.h
+++ b/src/network/ssl/qsslsocket_p.h
@@ -180,6 +180,7 @@ public:
void _q_channelReadyReadSlot(int);
void _q_bytesWrittenSlot(qint64);
void _q_channelBytesWrittenSlot(int, qint64);
+ void _q_readChannelFinishedSlot();
void _q_flushWriteBuffer();
void _q_flushReadBuffer();
void _q_resumeImplementation();