summaryrefslogtreecommitdiffstats
path: root/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp
diff options
context:
space:
mode:
authorRichard J. Moore <rich@kde.org>2014-05-12 21:16:20 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-05-14 11:08:01 +0200
commit1a8788d966da9698b05c1e0bd271d83c5bca9992 (patch)
treee1821d4037b171763172e77878ba8ee8ed730a60 /tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp
parentb861c43395b17d5df34f24853faa21b9824a53af (diff)
Move the PKCS#12 support from QSslSocket to QSslCertificate.
Discussed with Peter and agreed that it's a slightly better fit there. Change-Id: If8db777336e2273670a23d75d8542b30c07e0d7b Reviewed-by: Daniel Molkentin <daniel@molkentin.de> Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
Diffstat (limited to 'tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp')
-rw-r--r--tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp47
1 files changed, 0 insertions, 47 deletions
diff --git a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp
index 1ed2a98ed7..30a9e19138 100644
--- a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp
+++ b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp
@@ -194,7 +194,6 @@ private slots:
void qtbug18498_peek2();
void dhServer();
void ecdhServer();
- void pkcs12();
void setEmptyDefaultConfiguration(); // this test should be last
static void exitLoop()
@@ -2735,52 +2734,6 @@ void tst_QSslSocket::ecdhServer()
QVERIFY(client->state() == QAbstractSocket::ConnectedState);
}
-void tst_QSslSocket::pkcs12()
-{
- if (!QSslSocket::supportsSsl()) {
- qWarning("SSL not supported, skipping test");
- return;
- }
-
- QFETCH_GLOBAL(bool, setProxy);
- if (setProxy)
- return;
-
- QFile f(QLatin1String(SRCDIR "certs/leaf.p12"));
- bool ok = f.open(QIODevice::ReadOnly);
- QVERIFY(ok);
-
- QSslKey key;
- QSslCertificate cert;
- QList<QSslCertificate> caCerts;
-
- ok = QSslSocket::importPKCS12(&f, &key, &cert, &caCerts);
- QVERIFY(ok);
- f.close();
-
- QList<QSslCertificate> leafCert = QSslCertificate::fromPath(SRCDIR "certs/leaf.crt");
- QVERIFY(!leafCert.isEmpty());
-
- QCOMPARE(cert, leafCert.first());
-
- QFile f2(QLatin1String(SRCDIR "certs/leaf.key"));
- ok = f2.open(QIODevice::ReadOnly);
- QVERIFY(ok);
-
- QSslKey leafKey(&f2, QSsl::Rsa);
- f2.close();
-
- QVERIFY(!leafKey.isNull());
- QCOMPARE(key, leafKey);
-
- QList<QSslCertificate> caCert = QSslCertificate::fromPath(SRCDIR "certs/inter.crt");
- QVERIFY(!caCert.isEmpty());
-
- QVERIFY(!caCerts.isEmpty());
- QCOMPARE(caCerts.first(), caCert.first());
- QCOMPARE(caCerts, caCert);
-}
-
void tst_QSslSocket::setEmptyDefaultConfiguration() // this test should be last, as it has some side effects
{
// used to produce a crash in QSslConfigurationPrivate::deepCopyDefaultConfiguration, QTBUG-13265