TsgcWebSocketClient › Events › OnSSLVerifyPeer
Fires when VerifyCertificate is enabled so the application can accept or reject the server certificate.
public event TsgcOnSSLVerifyPeerHandler OnSSLVerifyPeer;
// delegate void TsgcOnSSLVerifyPeerHandler(TObject Sender, TIdX509 Certificate, bool AOk, int ADepth, int AError, out bool Accept)
—
When TLSOptions.VerifyCertificate is True and OpenSSL is the selected IOHandler, OnSSLVerifyPeer is raised once per certificate in the chain presented by the server. The Certificate parameter exposes the X.509 data, AOk contains OpenSSL's own verification result, ADepth is the position in the chain (0 for the leaf), and AError is the OpenSSL error code when verification fails. Set Accept to True to trust the certificate or False to abort the connection. When SChannel is used instead of OpenSSL, use OnSChannelVerifyPeer.