Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
src_network_ssl_qdtls.cpp File Reference

Go to the source code of this file.

Functions

clientDtls setPeer (address, port, peerName)
 
QByteArray clientHello (serverSocket.pendingDatagramSize(), Qt::Uninitialized)
 
serverSocket readDatagram (clientHello.data(), clientHello.size(), &address, &port)
 
serverDtls setPeer (address, port)
 
socket readDatagram (encryptedMessage.data(), dgramSize)
 
config setDtlsCookieVerificationEnabled (false)
 
dtlsConnection setDtlsConfiguration (config)
 
 if (!dtls.doHandshake(&socket, dgram))
 [4]
 
QSslError error (QSslError::SelfSignedCertificate, cert.at(0))
 
expectedSslErrors append (error)
 
dtls ignoreVerificationErrors (expectedSslErrors)
 
dtls doHandshake (udpSocket)
 

Variables

QUdpSocket clientSocket
 [0]
 
QDtls clientDtls
 
QHostAddress address
 
quin16 port = {}
 
QDtls serverDtls
 
serverDtls doHandshakeserverSocket
 
QByteArray encryptedMessage (dgramSize)
 
const QByteArray plainText = dtlsConnection.decryptDatagram(&socket, encryptedMessage)
 
auto config = QSslConfiguration::defaultDtlsConfiguration()
 [3]
 
QList< QSslCertificatecert = QSslCertificate::fromPath("server-certificate.pem"_L1)
 [5]
 
QList< QSslErrorexpectedSslErrors
 
QDtls dtls
 

Function Documentation

◆ append()

expectedSslErrors append ( error  )

◆ clientHello()

QByteArray clientHello ( serverSocket.  pendingDatagramSize(),
Qt::Uninitialized   
)

◆ doHandshake()

dtls doHandshake ( udpSocket  )

◆ error()

QSslError error ( QSslError::SelfSignedCertificate  ,
cert.  at
)

◆ if()

if ( !dtls.doHandshake &,  dgram)

[4]

[5]

Definition at line 76 of file src_network_ssl_qdtls.cpp.

References dtls, QDtls::dtlsError(), PeerVerificationError, and socket.

+ Here is the call graph for this function:

◆ ignoreVerificationErrors()

dtls ignoreVerificationErrors ( expectedSslErrors  )

◆ readDatagram() [1/2]

serverSocket readDatagram ( clientHello.  data(),
clientHello.  size(),
address,
port 
)

◆ readDatagram() [2/2]

socket readDatagram ( encryptedMessage.  data(),
dgramSize   
)

◆ setDtlsConfiguration()

dtlsConnection setDtlsConfiguration ( config  )

◆ setDtlsCookieVerificationEnabled()

config setDtlsCookieVerificationEnabled ( false  )

◆ setPeer() [1/2]

serverDtls setPeer ( address  ,
port   
)

◆ setPeer() [2/2]

clientDtls setPeer ( address  ,
port  ,
peerName   
)

Variable Documentation

◆ address

Definition at line 15 of file src_network_ssl_qdtls.cpp.

◆ cert

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

[5]

[6]

Definition at line 83 of file src_network_ssl_qdtls.cpp.

◆ clientDtls

QDtls clientDtls

Definition at line 8 of file src_network_ssl_qdtls.cpp.

◆ clientSocket

dtlsConnection writeDatagramEncrypted & clientSocket

[0]

[1]

[2]

Definition at line 7 of file src_network_ssl_qdtls.cpp.

Referenced by if().

◆ config

auto config = QSslConfiguration::defaultDtlsConfiguration()

[3]

[4]

Definition at line 69 of file src_network_ssl_qdtls.cpp.

◆ dtls

◆ encryptedMessage

QByteArray encryptedMessage(dgramSize) ( dgramSize  )

◆ expectedSslErrors

QList<QSslError> expectedSslErrors

Definition at line 85 of file src_network_ssl_qdtls.cpp.

◆ plainText

const QByteArray plainText = dtlsConnection.decryptDatagram(&socket, encryptedMessage)

Definition at line 58 of file src_network_ssl_qdtls.cpp.

Referenced by QTextDocumentFragment::fromPlainText().

◆ port

quin16 port = {}

Definition at line 16 of file src_network_ssl_qdtls.cpp.

◆ serverDtls

QDtls serverDtls

Definition at line 19 of file src_network_ssl_qdtls.cpp.

◆ serverSocket