TsgcHTTP2ClientEvents › OnSSLGetHandler

OnSSLGetHandler Event

Fires before the SSL handler is created so a custom handler instance can be supplied.

Syntax

property OnSSLGetHandler: TsgcTCPOnSSLGetHandler;
// TsgcTCPOnSSLGetHandler = procedure(Sender: TObject; aType: TwsSSLHandler; var aSSLHandler: TIdSSLIOHandlerSocketBase) of object

Default Value

Remarks

OnSSLGetHandler is raised just before the client builds the TLS IOHandler. Set aSSLHandler to an instance of your own class (inherited from TIdIOHandlerSSLBase) to replace the default handler, for example to wire a specialized OpenSSL or SChannel implementation. Leave aSSLHandler unassigned to let the client create the default handler, in which case OnSSLAfterCreateHandler can still be used to tweak properties after creation. The component takes ownership of the handler assigned here.

Example


procedure OnSSLGetHandler(Sender: TObject; aType: TwsSSLHandler;
  var aSSLHandler: TIdSSLIOHandlerSocketBase);
begin
  aSSLHandler := TCustomSSLHandler.Create(nil);
  // ... configure handler properties
end;

Back to Events