Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qsslserver.h
Go to the documentation of this file.
1// Copyright (C) 2022 The Qt Company Ltd.
2// Copyright (C) 2016 Kurt Pattyn <pattyn.kurt@gmail.com>.
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
4// Qt-Security score:significant reason:default
5
6#ifndef QSSLSERVER_H
7#define QSSLSERVER_H
8
9#include <QtNetwork/QTcpServer>
10
12
13#include <QtNetwork/QSslError>
14#include <QtNetwork/QSslConfiguration>
15#include <QtNetwork/QSslPreSharedKeyAuthenticator>
16#include <QtNetwork/QSslSocket>
17
18#include <QtCore/QList>
19
20QT_BEGIN_NAMESPACE
21
22class QSslSocket;
23class QSslServerPrivate;
24
25class Q_NETWORK_EXPORT QSslServer : public QTcpServer
26{
27 Q_OBJECT
28 Q_DISABLE_COPY_MOVE(QSslServer)
29
30public:
31 explicit QSslServer(QObject *parent = nullptr);
32 ~QSslServer() override;
33
34 void setSslConfiguration(const QSslConfiguration &sslConfiguration);
35 QSslConfiguration sslConfiguration() const;
36
37 void setHandshakeTimeout(int timeout);
38 int handshakeTimeout() const;
39
40Q_SIGNALS:
41 void sslErrors(QSslSocket *socket, const QList<QSslError> &errors);
42 void peerVerifyError(QSslSocket *socket, const QSslError &error);
43 void errorOccurred(QSslSocket *socket, QAbstractSocket::SocketError error);
44 void preSharedKeyAuthenticationRequired(QSslSocket *socket,
45 QSslPreSharedKeyAuthenticator *authenticator);
46 void alertSent(QSslSocket *socket, QSsl::AlertLevel level,
47 QSsl::AlertType type, const QString &description);
48 void alertReceived(QSslSocket *socket, QSsl::AlertLevel level,
49 QSsl::AlertType type, const QString &description);
50 void handshakeInterruptedOnError(QSslSocket *socket, const QSslError &error);
51 void startedEncryptionHandshake(QSslSocket *socket);
52
53protected:
54 void incomingConnection(qintptr socket) override;
55
56private:
57 Q_DECLARE_PRIVATE(QSslServer)
58};
59
60QT_END_NAMESPACE
61
62#endif // QSSLSERVER_H
\inmodule QtNetwork
Definition qsslserver.h:26
QT_REQUIRE_CONFIG(ssl)