diff options
Diffstat (limited to 'src/network/ssl/qsslpresharedkeyauthenticator.cpp')
-rw-r--r-- | src/network/ssl/qsslpresharedkeyauthenticator.cpp | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/src/network/ssl/qsslpresharedkeyauthenticator.cpp b/src/network/ssl/qsslpresharedkeyauthenticator.cpp index 8e1313493f..3bb2719026 100644 --- a/src/network/ssl/qsslpresharedkeyauthenticator.cpp +++ b/src/network/ssl/qsslpresharedkeyauthenticator.cpp @@ -83,28 +83,13 @@ QSslPreSharedKeyAuthenticatorPrivate::QSslPreSharedKeyAuthenticatorPrivate() completing the PSK handshake. The client application needs to connect a slot to the QSslSocket::preSharedKeyAuthenticationRequired() signal: - \code - - connect(socket, &QSslSocket::preSharedKeyAuthenticationRequired, - this, &AuthManager::handlePreSharedKeyAuthentication); - - \endcode + \snippet code/src_network_ssl_qsslpresharedkeyauthenticator.cpp 0 The signal carries a QSslPreSharedKeyAuthenticator object containing the identity hint the server sent to the client, and which must be filled with the corresponding client identity and the derived key: - \code - - void AuthManager::handlePreSharedKeyAuthentication(QSslPreSharedKeyAuthenticator *authenticator) - { - authenticator->setIdentity("My Qt App"); - - const QByteArray key = deriveKey(authenticator->identityHint(), passphrase); - authenticator->setPreSharedKey(key); - } - - \endcode + \snippet code/src_network_ssl_qsslpresharedkeyauthenticator.cpp 1 \note PSK ciphersuites are supported only when using OpenSSL 1.0.1 (or greater) as the SSL backend. |