TsgcWebSocketClientEvents › OnSChannelVerifyPeer

OnSChannelVerifyPeer Event

Fires when SChannel is the TLS IOHandler so the application can verify the server certificate.

Syntax

public event TsgcSChannelOnVerifyPeerEventHandler OnSChannelVerifyPeer;
// delegate void TsgcSChannelOnVerifyPeerEventHandler(TObject Sender, TsgcSChannelContext aContext, TsgcSChannelVerifyError aError, out bool Accept)

Default Value

Remarks

When TLSOptions.IOHandler is iohSChannel this event is raised during the TLS handshake so the application can inspect the server certificate and decide whether to accept the connection. The aContext parameter exposes the certificate chain and SChannel context data; aError reports the validation result returned by SChannel (for example, expired, untrusted root, name mismatch). Set Accept to True to continue the handshake or False to abort the connection. When OpenSSL is used instead of SChannel, use OnSSLVerifyPeer.

Example

Back to Events