diff options
author | Martin Petersson <martin.petersson@nokia.com> | 2011-03-14 14:25:33 +0100 |
---|---|---|
committer | Martin Petersson <martin.petersson@nokia.com> | 2011-03-14 14:25:33 +0100 |
commit | 5f2eccbc8a392784868dd9919442642b4a9f9ef8 (patch) | |
tree | b1c9acf7cd282cc48817eb330dc3044c612b1a33 /src/network/ssl | |
parent | e90cff53cdd7bf0bdfed1f2e8efb90539c6f33ba (diff) | |
download | qt4-tools-5f2eccbc8a392784868dd9919442642b4a9f9ef8.tar.gz |
SSL: Fix certification loading on Mac OS X 10.5
Do not add the expired certificates on Mac OS X 10.5.
Task-number: QTBUG-14520
Reviewed-by: Markus Goetz
Diffstat (limited to 'src/network/ssl')
-rw-r--r-- | src/network/ssl/qsslsocket_openssl.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp index 84e14ffb0d..08665343e0 100644 --- a/src/network/ssl/qsslsocket_openssl.cpp +++ b/src/network/ssl/qsslsocket_openssl.cpp @@ -312,9 +312,18 @@ init_context: q_X509_STORE_add_cert(ctx->cert_store, (X509 *)caCertificate.handle()); } } + + bool addExpiredCerts = true; +#if defined(Q_OS_MAC) && (MAC_OS_X_VERSION_MAX_ALLOWED == MAC_OS_X_VERSION_10_5) + //On Leopard SSL does not work if we add the expired certificates. + if (QSysInfo::MacintoshVersion == QSysInfo::MV_10_5) + addExpiredCerts = false; +#endif // now add the expired certs - foreach (const QSslCertificate &caCertificate, expiredCerts) { - q_X509_STORE_add_cert(ctx->cert_store, (X509 *)caCertificate.handle()); + if (addExpiredCerts) { + foreach (const QSslCertificate &caCertificate, expiredCerts) { + q_X509_STORE_add_cert(ctx->cert_store, (X509 *)caCertificate.handle()); + } } // Register a custom callback to get all verification errors. |