Add accessors for the build-time version of openssl.

Many bugs originate due to mismatches between the build-time and
run-time versions of openssl but they're hard to debug as we don't
provide access to the build-time info. This addresses that weakness.

[ChangeLog][QtNetwork][QSslSocket] Added accessors for the version
of openssl used at build-time. This will help when debugging
problems caused by a mismatch with the run-time version.

Change-Id: I6a4c21c8f16ab4c90cdf166f38c62fe37bf1f165
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
This commit is contained in:
Richard J. Moore 2014-03-10 16:39:46 +00:00 committed by The Qt Project
parent 233a2f37bf
commit 3683bc97d2
4 changed files with 40 additions and 0 deletions

View File

@ -1679,6 +1679,32 @@ QString QSslSocket::sslLibraryVersionString()
return QSslSocketPrivate::sslLibraryVersionString(); return QSslSocketPrivate::sslLibraryVersionString();
} }
/*!
\since 5.4
Returns the version number of the SSL library in use at compile
time. If no SSL support is available then this will return an
undefined value.
\sa sslLibraryVersionNumber()
*/
long QSslSocket::sslLibraryBuildVersionNumber()
{
return QSslSocketPrivate::sslLibraryBuildVersionNumber();
}
/*!
\since 5.4
Returns the version string of the SSL library in use at compile
time. If no SSL support is available then this will return an
empty value.
\sa sslLibraryVersionString()
*/
QString QSslSocket::sslLibraryBuildVersionString()
{
return QSslSocketPrivate::sslLibraryBuildVersionString();
}
/*! /*!
Starts a delayed SSL handshake for a client connection. This Starts a delayed SSL handshake for a client connection. This
function can be called when the socket is in the \l ConnectedState function can be called when the socket is in the \l ConnectedState

View File

@ -183,6 +183,8 @@ public:
static bool supportsSsl(); static bool supportsSsl();
static long sslLibraryVersionNumber(); static long sslLibraryVersionNumber();
static QString sslLibraryVersionString(); static QString sslLibraryVersionString();
static long sslLibraryBuildVersionNumber();
static QString sslLibraryBuildVersionString();
void ignoreSslErrors(const QList<QSslError> &errors); void ignoreSslErrors(const QList<QSslError> &errors);

View File

@ -584,6 +584,16 @@ QString QSslSocketPrivate::sslLibraryVersionString()
return QString::fromLatin1(versionString); return QString::fromLatin1(versionString);
} }
long QSslSocketPrivate::sslLibraryBuildVersionNumber()
{
return OPENSSL_VERSION_NUMBER;
}
QString QSslSocketPrivate::sslLibraryBuildVersionString()
{
return QLatin1String(OPENSSL_VERSION_TEXT);
}
/*! /*!
\internal \internal

View File

@ -129,6 +129,8 @@ public:
static bool supportsSsl(); static bool supportsSsl();
static long sslLibraryVersionNumber(); static long sslLibraryVersionNumber();
static QString sslLibraryVersionString(); static QString sslLibraryVersionString();
static long sslLibraryBuildVersionNumber();
static QString sslLibraryBuildVersionString();
static void ensureInitialized(); static void ensureInitialized();
static void deinitialize(); static void deinitialize();
static QList<QSslCipher> defaultCiphers(); static QList<QSslCipher> defaultCiphers();