15void SslServer::incomingConnection(
qintptr socketDescriptor)
18 if (
serverSocket->setSocketDescriptor(socketDescriptor)) {
31socket.connectToHostEncrypted(
"http.example.com", 443);
47socket.connectToHostEncrypted(
"imap", 993);
53socket->connectToHostEncrypted(
"imap", 993);
54if (
socket->waitForEncrypted(1000))
66socket.connectToHostEncrypted(
"server.tld", 443);
bool waitForReadyRead(int msecs=30000) override
This function blocks until new data is available for reading and the \l{QIODevice::}{readyRead()} sig...
char * data()
\macro QT_NO_CAST_FROM_BYTEARRAY
QByteArray readAll()
Reads all remaining data from the device, and returns it as a byte array.
qint64 write(const char *data, qint64 len)
Writes at most maxSize bytes of data from data to the device.
QString errorString() const
Returns a human-readable description of the last device error that occurred.
const_reference at(qsizetype i) const noexcept
void append(parameter_type t)
static QList< QSslCertificate > fromPath(const QString &path, QSsl::EncodingFormat format=QSsl::Pem, PatternSyntax syntax=PatternSyntax::FixedString)
The QSslError class provides an SSL error.
The QSslSocket class provides an SSL encrypted socket for both clients and servers.
void encrypted()
This signal is emitted when QSslSocket enters encrypted mode.
void connectToHostEncrypted(const QString &hostName, quint16 port, OpenMode mode=ReadWrite, NetworkLayerProtocol protocol=AnyIPProtocol)
Starts an encrypted connection to the device hostName on port, using mode as the \l OpenMode.
DBusConnection const char DBusError * error
connect(quitButton, &QPushButton::clicked, &app, &QCoreApplication::quit, Qt::QueuedConnection)
QList< QSslError > expectedSslErrors
QList< QSslCertificate > cert
[0]
serverDtls doHandshake & serverSocket
connect(socket, &QSslSocket::encrypted, this, &Receiver::ready)