summaryrefslogtreecommitdiffstats
path: root/tests/auto/network
diff options
context:
space:
mode:
authorRichard Moore <rich@kde.org>2013-02-11 17:14:25 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-02-19 21:37:14 +0100
commit4a07519877b4b3aad45d1a727487d9e87630973b (patch)
tree8bbd4df14107917fca40b35dd145547376f7508d /tests/auto/network
parent5dbd42a62ee56297b3b3b1881644efa5e0b5b594 (diff)
Store the local certificate in a QList.
Instead of storing a single QSslCertificate for a the local cert, store a list of them. This will allow us to handle server sockets that use a certificate that is not issued directly from the CA root in future. Change-Id: I9a36b9a99daa9c0bdd17f61b4ce1a7da746f2e96 Reviewed-by: Peter Hartmann <phartmann@rim.com>
Diffstat (limited to 'tests/auto/network')
-rw-r--r--tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp
index c1c090a953..96dd0915a2 100644
--- a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp
+++ b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp
@@ -142,6 +142,7 @@ private slots:
void protocolServerSide();
void setCaCertificates();
void setLocalCertificate();
+ void localCertificateChain();
void setPrivateKey();
void setSocketDescriptor();
void setSslConfiguration_data();
@@ -1100,6 +1101,21 @@ void tst_QSslSocket::setLocalCertificate()
{
}
+void tst_QSslSocket::localCertificateChain()
+{
+ if (!QSslSocket::supportsSsl())
+ return;
+
+ QSslSocket socket;
+ socket.setLocalCertificate(QLatin1String(SRCDIR "certs/fluke.cert"));
+
+ QSslConfiguration conf = socket.sslConfiguration();
+ QList<QSslCertificate> chain = conf.localCertificateChain();
+ QCOMPARE(chain.size(), 1);
+ QCOMPARE(chain[0], conf.localCertificate());
+ QCOMPARE(chain[0], socket.localCertificate());
+}
+
void tst_QSslSocket::setPrivateKey()
{
}