TsgcUDPServerProperties › DTLS

DTLS Property

Enables Datagram TLS (DTLS) to encrypt the UDP traffic received and sent by this server.

Syntax

property DTLS: Boolean read FDTLS write FDTLS;

Default Value

Remarks

When True, every datagram received by the server is decrypted through a DTLS handshake, and WriteData encrypts outbound datagrams before they leave the socket; when False the server handles raw UDP. DTLS support requires OpenSSL API 1.1 or 3.0 (configured through DTLSOptions.OpenSSL_Options.APIVersion) and our custom Indy build, and is only available in the Enterprise edition. The OnDTLSVerifyPeer event is fired during each handshake so the application can validate the client certificate. Call ClearDTLS to discard the cached DTLS sessions (for example, after modifying DTLSOptions).

Example

oServer.DTLS := True;
oServer.DTLSOptions.CertFile := 'server.pem';
oServer.DTLSOptions.KeyFile := 'server.key';

Back to Properties