TsgcHTTP2ClientEvents › OnSSLAfterCreateHandler

OnSSLAfterCreateHandler Event

Fires after the SSL handler has been created so its properties can be customized.

Syntax

property OnSSLAfterCreateHandler: TsgcTCPOnSSLAfterCreateHandler;
// TsgcTCPOnSSLAfterCreateHandler = procedure(Sender: TObject; aType: TwsSSLHandler; aSSLHandler: TIdSSLIOHandlerSocketBase) of object

Default Value

Remarks

If OnSSLGetHandler does not supply a custom SSL handler, the client creates the default one (OpenSSL or SChannel depending on TLSOptions.IOHandler) and then raises OnSSLAfterCreateHandler so the application can tune its properties, for example to force a specific TLS method, enable specific ciphers, or capture the SChannel handler to later query connection info. The aType parameter reports which kind of handler was built and aSSLHandler is the instance that will actually perform the TLS handshake; the event does not own the handler and you must not free it.

Example


procedure OnSSLAfterCreateHandler(Sender: TObject; aType: TwsSSLHandler;
  aSSLHandler: TIdSSLIOHandlerSocketBase);
begin
  TIdSSLIOHandlerSocketOpenSSL(aSSLHandler).SSLOptions.Method := sslvTLSv1_2;
end;

Back to Events