TsgcUDPCLient › Properties › DTLS
Enables Datagram TLS (DTLS) to encrypt the UDP traffic sent and received by this client.
property DTLS: Boolean read FDTLS write FDTLS;
—
When True, datagrams are wrapped in DTLS and a TLS handshake is performed with the peer on first use; when False, the client sends and receives raw UDP. DTLS support requires OpenSSL API 1.1 or 3.0 (configured through DTLSOptions.OpenSSL_Options.APIVersion) and our custom Indy build. DTLS is available only in the Enterprise edition. The OnDTLSVerifyPeer event is fired during the handshake so the application can validate the server certificate. Call ClearDTLS to discard the cached DTLS session before connecting to a different peer.
oClient.DTLS := True;
oClient.DTLSOptions.VerifyCertificate := True;
oClient.DTLSOptions.RootCertFile := 'root.pem';