Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
src_network_ssl_qsslsocket.cpp File Reference

(69d4ecd6ef9057cb3703178277042ff7a7411459)

Go to the source code of this file.

Functions

 connect (socket, &QSslSocket::encrypted, this, &Receiver::ready)
 
socket connectToHostEncrypted ("imap.example.com", 993)
 
socket connectToHostEncrypted ("http.example.com", 443)
 
 if (!socket.waitForEncrypted())
 
socket write ("GET / HTTP/1.0\r\n\r\n")
 
 while (socket.waitForReadyRead()) qDebug()<< socket.readAll().data()
 
socket connectToHostEncrypted ("imap", 993)
 [3]
 
socket write ("1 CAPABILITY\r\n")
 
 if (socket->waitForEncrypted(1000)) qDebug("Encrypted!")
 
QSslError error (QSslError::SelfSignedCertificate, cert.at(0))
 
expectedSslErrors append (error)
 
socket ignoreSslErrors (expectedSslErrors)
 
socket connectToHostEncrypted ("server.tld", 443)
 

Variables

QSslSocketsocket = new QSslSocket(this)
 [0]
 
QList< QSslCertificatecert = QSslCertificate::fromPath("server-certificate.pem"_L1)
 [5]
 
QList< QSslErrorexpectedSslErrors
 

Function Documentation

◆ append()

◆ connect()

connect ( socket ,
&QSslSocket::encrypted ,
this ,
&Receiver::ready  )

◆ connectToHostEncrypted() [1/4]

socket connectToHostEncrypted ( "http.example.com" ,
443  )

◆ connectToHostEncrypted() [2/4]

socket connectToHostEncrypted ( "imap" ,
993  )

[3]

[5]

◆ connectToHostEncrypted() [3/4]

socket connectToHostEncrypted ( "imap.example.com" ,
993  )

References connect(), QSslSocket::encrypted(), and serverSocket.

+ Here is the call graph for this function:

◆ connectToHostEncrypted() [4/4]

socket connectToHostEncrypted ( "server.tld" ,
443  )

◆ error()

◆ if() [1/2]

if ( !socket. waitForEncrypted())

Definition at line 32 of file src_network_ssl_qsslsocket.cpp.

References QIODevice::errorString(), qDebug, and socket.

+ Here is the call graph for this function:

◆ if() [2/2]

if ( socket-> waitForEncrypted1000)

Definition at line 10 of file src_network_socket_qsctpsocket.cpp.

◆ ignoreSslErrors()

socket ignoreSslErrors ( expectedSslErrors )

◆ while()

while ( socket. waitForReadyRead())

◆ write() [1/2]

socket write ( "1 CAPABILITY\r\n" )

◆ write() [2/2]

socket write ( "GET / HTTP/1.0\r\n\r\n" )

Variable Documentation

◆ cert

QList<QSslCertificate> cert = QSslCertificate::fromPath("server-certificate.pem"_L1)

[5]

[6]

Definition at line 59 of file src_network_ssl_qsslsocket.cpp.

◆ expectedSslErrors

QList<QSslError> expectedSslErrors

Definition at line 61 of file src_network_ssl_qsslsocket.cpp.

◆ socket

QSslSocket socket = new QSslSocket(this)

[0]

[1]

[2]

[3]

Definition at line 7 of file src_network_ssl_qsslsocket.cpp.