184#include <QtNetwork/QSslSocket>
185#include <QtNetwork/QSslCipher>
234 return d->sslConfiguration;
270 return d->handshakeTimeout;
303 d->removeSocketData(
quintptr(pSslSocket));
326 d_func()->initializeHandshakeProcess(pSslSocket);
343 it->timeoutTimer->setSingleShot(
true);
346 it->timeoutTimer->start();
355 it->disconnectSignals();
381 if (foundData &&
it->readyReadConnection)
384 constexpr char CLIENT_HELLO = 0x16;
385 if (
byte != CLIENT_HELLO) {
393 it->timeoutTimer->start();
395 socket->startServerEncryption();
407 q->resumeAccepting();
412#include "moc_qsslserver.cpp"
virtual bool isReadNotificationEnabled() const =0
The QAbstractSocket class provides the base functionality common to all socket types.
void errorOccurred(QAbstractSocket::SocketError)
qint64 bytesAvailable() const override
Returns the number of incoming bytes that are waiting to be read.
virtual void disconnectFromHost()
Attempts to close the socket.
SocketError
This enum describes the socket errors that can occur.
void readyRead()
This signal is emitted once every time new data is available for reading from the device's current re...
qint64 peek(char *data, qint64 maxlen)
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
static bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *member)
\threadsafe
void destroyed(QObject *=nullptr)
This signal is emitted immediately before the object obj is destroyed, after any instances of QPointe...
void deleteLater()
\threadsafe
The QSslConfiguration class holds the configuration and state of an SSL connection.
The QSslError class provides an SSL error.
The QSslPreSharedKeyAuthenticator class provides authentication data for pre shared keys (PSK) cipher...
void initializeHandshakeProcess(QSslSocket *socket)
void removeSocketData(quintptr socket)
void checkClientHelloAndContinue()
int totalPendingConnections() const override
QHash< quintptr, SocketData > socketData
void handleHandshakeTimedOut(QSslSocket *socket)
void setSslConfiguration(const QSslConfiguration &sslConfiguration)
Sets the sslConfiguration to use for all following incoming connections.
void peerVerifyError(QSslSocket *socket, const QSslError &error)
QSslServer can emit this signal several times during the SSL handshake, before encryption has been es...
void errorOccurred(QSslSocket *socket, QAbstractSocket::SocketError error)
This signal is emitted after an error occurred during handshake.
void handshakeInterruptedOnError(QSslSocket *socket, const QSslError &error)
QSslServer emits this signal if a certificate verification error was found by socket and if early err...
QSslConfiguration sslConfiguration() const
Returns the current ssl configuration.
void incomingConnection(qintptr socket) override
Called when a new connection is established.
void setHandshakeTimeout(int timeout)
Sets the timeout to use for all incoming handshakes, in milliseconds.
void alertSent(QSslSocket *socket, QSsl::AlertLevel level, QSsl::AlertType type, const QString &description)
QSslServer emits this signal if an alert message was sent from socket to a peer.
void alertReceived(QSslSocket *socket, QSsl::AlertLevel level, QSsl::AlertType type, const QString &description)
QSslServer emits this signal if an alert message was received by the socket from a peer.
void sslErrors(QSslSocket *socket, const QList< QSslError > &errors)
QSslServer emits this signal after the SSL handshake to indicate that one or more errors have occurre...
~QSslServer() override
Destroys the QSslServer.
int handshakeTimeout() const
Returns the currently configured handshake timeout.
QSslServer(QObject *parent=nullptr)
Constructs a new QSslServer with the given parent.
void preSharedKeyAuthenticationRequired(QSslSocket *socket, QSslPreSharedKeyAuthenticator *authenticator)
QSslServer emits this signal when socket negotiates a PSK ciphersuite, and therefore PSK authenticati...
The QSslSocket class provides an SSL encrypted socket for both clients and servers.
void sslErrors(const QList< QSslError > &errors)
QSslSocket emits this signal after the SSL handshake to indicate that one or more errors have occurre...
bool isEncrypted() const
Returns true if the socket is encrypted; otherwise, false is returned.
void alertSent(QSsl::AlertLevel level, QSsl::AlertType type, const QString &description)
QSslSocket emits this signal if an alert message was sent to a peer.
void peerVerifyError(const QSslError &error)
bool setSocketDescriptor(qintptr socketDescriptor, SocketState state=ConnectedState, OpenMode openMode=ReadWrite) override
Initializes QSslSocket with the native socket descriptor socketDescriptor.
void preSharedKeyAuthenticationRequired(QSslPreSharedKeyAuthenticator *authenticator)
void encrypted()
This signal is emitted when QSslSocket enters encrypted mode.
void setSslConfiguration(const QSslConfiguration &config)
void alertReceived(QSsl::AlertLevel level, QSsl::AlertType type, const QString &description)
QSslSocket emits this signal if an alert message was received from a peer.
void handshakeInterruptedOnError(const QSslError &error)
QSslSocket emits this signal if a certificate verification error was found and if early error reporti...
\macro QT_RESTRICTED_CAST_FROM_ASCII
QAbstractSocketEngine * socketEngine
virtual int totalPendingConnections() const
The QTcpServer class provides a TCP-based server.
void addPendingConnection(QTcpSocket *socket)
This function is called by QTcpServer::incomingConnection() to add the socket to the list of pending ...
QSet< QString >::iterator it
Combined button and popup list for selecting options.
DBusConnection const char DBusError * error
GLenum GLuint GLint level
GLbitfield GLuint64 timeout
[4]
GLdouble GLdouble GLdouble GLdouble q
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent