--- qt-everywhere-commercial-src-4.8.2/src/network/network.qrc	1969-12-31 19:00:00.000000000 -0500
+++ qt-everywhere-commercial-src-4.8.2/src/network/network.qrc	2011-08-25 11:07:55.000000000 -0400
@@ -0,0 +1,5 @@
+<RCC>
+	<qresource prefix="/trolltech/network">
+		<file>ssl/qt-ca-bundle.crt</file>
+	</qresource>
+</RCC>
--- qt-everywhere-commercial-src-4.8.2/src/network/ssl/qsslsocket_openssl.cpp	2012-07-27 15:06:04.000000000 -0400
+++ qt-everywhere-commercial-src-4.8.2/src/network/ssl/qsslsocket_openssl.cpp	2012-07-27 15:18:04.000000000 -0400
@@ -49,22 +49,6 @@
 #endif
 QT_BEGIN_NAMESPACE
 
-#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES)
-#define kSecTrustSettingsDomainSystem 2 // so we do not need to include the header file
-    PtrSecCertificateGetData QSslSocketPrivate::ptrSecCertificateGetData = 0;
-    PtrSecTrustSettingsCopyCertificates QSslSocketPrivate::ptrSecTrustSettingsCopyCertificates = 0;
-    PtrSecTrustCopyAnchorCertificates QSslSocketPrivate::ptrSecTrustCopyAnchorCertificates = 0;
-#elif defined(Q_OS_WIN)
-    PtrCertOpenSystemStoreW QSslSocketPrivate::ptrCertOpenSystemStoreW = 0;
-    PtrCertFindCertificateInStore QSslSocketPrivate::ptrCertFindCertificateInStore = 0;
-    PtrCertCloseStore QSslSocketPrivate::ptrCertCloseStore = 0;
-#elif defined(Q_OS_SYMBIAN)
-#include <e32base.h>
-#include <e32std.h>
-#include <e32debug.h>
-#include <QtCore/private/qcore_symbian_p.h>
-#endif
-
 bool QSslSocketPrivate::s_libraryLoaded = false;
 bool QSslSocketPrivate::s_loadedCiphersAndCerts = false;
 bool QSslSocketPrivate::s_loadRootCertsOnDemand = false;
@@ -560,53 +544,6 @@
 
     resetDefaultCiphers();
 
-    //load symbols needed to receive certificates from system store
-#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES)
-    QLibrary securityLib("/System/Library/Frameworks/Security.framework/Versions/Current/Security");
-    if (securityLib.load()) {
-        ptrSecCertificateGetData = (PtrSecCertificateGetData) securityLib.resolve("SecCertificateGetData");
-        if (!ptrSecCertificateGetData)
-            qWarning("could not resolve symbols in security library"); // should never happen
-
-        ptrSecTrustSettingsCopyCertificates = (PtrSecTrustSettingsCopyCertificates) securityLib.resolve("SecTrustSettingsCopyCertificates");
-        if (!ptrSecTrustSettingsCopyCertificates) { // method was introduced in Leopard, use legacy method if it's not there
-            ptrSecTrustCopyAnchorCertificates = (PtrSecTrustCopyAnchorCertificates) securityLib.resolve("SecTrustCopyAnchorCertificates");
-            if (!ptrSecTrustCopyAnchorCertificates)
-                qWarning("could not resolve symbols in security library"); // should never happen
-        }
-    } else {
-        qWarning("could not load security library");
-    }
-#elif defined(Q_OS_WIN)
-    HINSTANCE hLib = LoadLibraryW(L"Crypt32");
-    if (hLib) {
-#if defined(Q_OS_WINCE)
-        ptrCertOpenSystemStoreW = (PtrCertOpenSystemStoreW)GetProcAddress(hLib, L"CertOpenStore");
-        ptrCertFindCertificateInStore = (PtrCertFindCertificateInStore)GetProcAddress(hLib, L"CertFindCertificateInStore");
-        ptrCertCloseStore = (PtrCertCloseStore)GetProcAddress(hLib, L"CertCloseStore");
-#else
-        ptrCertOpenSystemStoreW = (PtrCertOpenSystemStoreW)GetProcAddress(hLib, "CertOpenSystemStoreW");
-        ptrCertFindCertificateInStore = (PtrCertFindCertificateInStore)GetProcAddress(hLib, "CertFindCertificateInStore");
-        ptrCertCloseStore = (PtrCertCloseStore)GetProcAddress(hLib, "CertCloseStore");
-#endif
-        if (!ptrCertOpenSystemStoreW || !ptrCertFindCertificateInStore || !ptrCertCloseStore)
-            qWarning("could not resolve symbols in crypt32 library"); // should never happen
-    } else {
-        qWarning("could not load crypt32 library"); // should never happen
-    }
-#elif defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN) && !defined(Q_OS_MAC)
-    // check whether we can enable on-demand root-cert loading (i.e. check whether the sym links are there)
-    QList<QByteArray> dirs = unixRootCertDirectories();
-    QStringList symLinkFilter;
-    symLinkFilter << QLatin1String("[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f].[0-9]");
-    for (int a = 0; a < dirs.count(); ++a) {
-        QDirIterator iterator(QLatin1String(dirs.at(a)), symLinkFilter, QDir::Files);
-        if (iterator.hasNext()) {
-            s_loadRootCertsOnDemand = true;
-            break;
-        }
-    }
-#endif
     // if on-demand loading was not enabled, load the certs now
     if (!s_loadRootCertsOnDemand)
         setDefaultCaCertificates(systemCaCertificates());
@@ -836,117 +773,13 @@
 
 QList<QSslCertificate> QSslSocketPrivate::systemCaCertificates()
 {
-    ensureInitialized();
-#ifdef QSSLSOCKET_DEBUG
-    QElapsedTimer timer;
-    timer.start();
-#endif
-    QList<QSslCertificate> systemCerts;
-#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES)
-    CFArrayRef cfCerts;
-    OSStatus status = 1;
-
-    OSStatus SecCertificateGetData (
-       SecCertificateRef certificate,
-       CSSM_DATA_PTR data
-    );
-
-    if (ptrSecCertificateGetData) {
-        if (ptrSecTrustSettingsCopyCertificates)
-            status = ptrSecTrustSettingsCopyCertificates(kSecTrustSettingsDomainSystem, &cfCerts);
-        else if (ptrSecTrustCopyAnchorCertificates)
-            status = ptrSecTrustCopyAnchorCertificates(&cfCerts);
-        if (!status) {
-            CFIndex size = CFArrayGetCount(cfCerts);
-            for (CFIndex i = 0; i < size; ++i) {
-                SecCertificateRef cfCert = (SecCertificateRef)CFArrayGetValueAtIndex(cfCerts, i);
-                CSSM_DATA data;
-                CSSM_DATA_PTR dataPtr = &data;
-                if (ptrSecCertificateGetData(cfCert, dataPtr)) {
-                    qWarning("error retrieving a CA certificate from the system store");
-                } else {
-                    int len = data.Length;
-                    char *rawData = reinterpret_cast<char *>(data.Data);
-                    QByteArray rawCert(rawData, len);
-                    systemCerts.append(QSslCertificate::fromData(rawCert, QSsl::Der));
-                }
-            }
-            CFRelease(cfCerts);
-        }
-        else {
-           // no detailed error handling here
-           qWarning("could not retrieve system CA certificates");
-        }
-    }
-#elif defined(Q_OS_WIN)
-    if (ptrCertOpenSystemStoreW && ptrCertFindCertificateInStore && ptrCertCloseStore) {
-        HCERTSTORE hSystemStore;
-#if defined(Q_OS_WINCE)
-        hSystemStore = ptrCertOpenSystemStoreW(CERT_STORE_PROV_SYSTEM_W,
-                                               0,
-                                               0,
-                                               CERT_STORE_NO_CRYPT_RELEASE_FLAG|CERT_SYSTEM_STORE_CURRENT_USER,
-                                               L"ROOT");
-#else
-        hSystemStore = ptrCertOpenSystemStoreW(0, L"ROOT");
-#endif
-        if(hSystemStore) {
-            PCCERT_CONTEXT pc = NULL;
-            while(1) {
-                pc = ptrCertFindCertificateInStore( hSystemStore, X509_ASN_ENCODING, 0, CERT_FIND_ANY, NULL, pc);
-                if(!pc)
-                    break;
-                QByteArray der((const char *)(pc->pbCertEncoded), static_cast<int>(pc->cbCertEncoded));
-                QSslCertificate cert(der, QSsl::Der);
-                systemCerts.append(cert);
-            }
-            ptrCertCloseStore(hSystemStore, 0);
-        }
-    }
-#elif defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN)
-    QSet<QString> certFiles;
-    QList<QByteArray> directories = unixRootCertDirectories();
-    QDir currentDir;
-    QStringList nameFilters;
-    nameFilters << QLatin1String("*.pem") << QLatin1String("*.crt");
-    currentDir.setNameFilters(nameFilters);
-    for (int a = 0; a < directories.count(); a++) {
-        currentDir.setPath(QLatin1String(directories.at(a)));
-        QDirIterator it(currentDir);
-        while(it.hasNext()) {
-            it.next();
-            // use canonical path here to not load the same certificate twice if symlinked
-            certFiles.insert(it.fileInfo().canonicalFilePath());
-        }
-    }
-    QSetIterator<QString> it(certFiles);
-    while(it.hasNext()) {
-        systemCerts.append(QSslCertificate::fromPath(it.next()));
-    }
-    systemCerts.append(QSslCertificate::fromPath(QLatin1String("/etc/pki/tls/certs/ca-bundle.crt"), QSsl::Pem)); // Fedora, Mandriva
-    systemCerts.append(QSslCertificate::fromPath(QLatin1String("/usr/local/share/certs/ca-root-nss.crt"), QSsl::Pem)); // FreeBSD's ca_root_nss
-
-#elif defined(Q_OS_SYMBIAN)
-    QList<QByteArray> certs;
-    QScopedPointer<CSymbianCertificateRetriever> retriever(CSymbianCertificateRetriever::NewL());
-
-    retriever->GetCertificates(certs);
-    foreach (const QByteArray &encodedCert, certs) {
-        QSslCertificate cert(encodedCert, QSsl::Der);
-        if (!cert.isNull()) {
-#ifdef QSSLSOCKET_DEBUG
-            qDebug() << "imported certificate: " << cert.issuerInfo(QSslCertificate::CommonName);
-#endif
-            systemCerts.append(cert);
-        }
-    }
-#endif
-#ifdef QSSLSOCKET_DEBUG
-    qDebug() << "systemCaCertificates retrieval time " << timer.elapsed() << "ms";
-    qDebug() << "imported " << systemCerts.count() << " certificates";
-#endif
+    // Qt provides a default bundle of certificates
+    QFile caBundle(QLatin1String(":/trolltech/network/ssl/qt-ca-bundle.crt"));
+    if (caBundle.open(QIODevice::ReadOnly | QIODevice::Text))
+	return QSslCertificate::fromDevice(&caBundle);
 
-    return systemCerts;
+    // Unreachable; return no bundle.
+    return QList<QSslCertificate>();
 }
 
 void QSslSocketBackendPrivate::startClientEncryption()
--- qt-everywhere-commercial-src-4.8.2/src/network/ssl/ssl.pri	2011-04-21 06:17:47.000000000 -0400
+++ qt-everywhere-commercial-src-4.8.2/src/network/ssl/ssl.pri	2011-08-25 11:08:54.000000000 -0400
@@ -31,6 +31,8 @@
                ssl/qsslsocket_openssl.cpp \
                ssl/qsslsocket_openssl_symbols.cpp
 
+    RESOURCES += network.qrc
+
     # Add optional SSL libs
     LIBS_PRIVATE += $$OPENSSL_LIBS
 }
