4using namespace Qt::StringLiterals;
8connect(socket, &QSslSocket::encrypted,
this, &Receiver::ready);
10socket->connectToHostEncrypted(
"imap.example.com", 993);
15void SslServer::incomingConnection(qintptr socketDescriptor)
17 QSslSocket *serverSocket =
new QSslSocket;
18 if (serverSocket->setSocketDescriptor(socketDescriptor)) {
19 addPendingConnection(serverSocket);
20 connect(serverSocket, &QSslSocket::encrypted,
this, &SslServer::ready);
21 serverSocket->startServerEncryption();
31socket.connectToHostEncrypted(
"http.example.com", 443);
32if (!socket.waitForEncrypted()) {
33 qDebug() << socket.errorString();
37socket.write(
"GET / HTTP/1.0\r\n\r\n");
38while (socket.waitForReadyRead())
39 qDebug() << socket.readAll().data();
45connect(&socket, &QSslSocket::encrypted, receiver, &Receiver::socketEncrypted);
47socket.connectToHostEncrypted(
"imap", 993);
48socket->write(
"1 CAPABILITY\r\n");
53socket->connectToHostEncrypted(
"imap", 993);
54if (socket->waitForEncrypted(1000))
62expectedSslErrors.append(error);
65socket.ignoreSslErrors(expectedSslErrors);
66socket.connectToHostEncrypted(
"server.tld", 443);
connect(manager, &QNetworkAccessManager::finished, this, &MyClass::replyFinished)
QList< QSslCertificate > cert
[0]
QList< QSslError > expectedSslErrors