diff options
author | Richard Moore <rich@kde.org> | 2013-02-11 17:14:25 +0000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-02-19 21:37:14 +0100 |
commit | 4a07519877b4b3aad45d1a727487d9e87630973b (patch) | |
tree | 8bbd4df14107917fca40b35dd145547376f7508d /tests/auto/network | |
parent | 5dbd42a62ee56297b3b3b1881644efa5e0b5b594 (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.cpp | 16 |
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() { } |