TsgcUDPCLientEvents › OnDTLSVerifyPeer

OnDTLSVerifyPeer Event

Fires during the DTLS handshake so the application can inspect and accept or reject the peer certificate.

Syntax

property OnDTLSVerifyPeer: TsgcUDPDTLSVerifyPeerEvent;
// TsgcUDPDTLSVerifyPeerEvent = procedure(Sender: TObject) of object

Default Value

Remarks

Fired by the DTLS engine during the handshake when DTLS is True and DTLSOptions.VerifyCertificate is enabled. Use the event to apply application-specific validation rules (for example, pinning the expected Common Name, checking a custom certificate store, or logging the certificate fingerprint) in addition to the chain validation performed by OpenSSL. The handler must be implemented in a thread-safe manner because it is invoked on the DTLS reader thread before any datagram is accepted.

Example

procedure TForm1.oClientDTLSVerifyPeer(Sender: TObject);
begin
  Memo1.Lines.Add('DTLS peer certificate received');
end;

Back to Events