TsgcWebSocketServerEvents › OnSSLGetHandler

OnSSLGetHandler Event

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

Syntax

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

Default Value

Remarks

OnSSLGetHandler is raised just before the server builds the TLS IOHandler used for SSL bindings. Assign aSSLHandler to an instance of your own class inherited from TIdServerIOHandlerSSLBase (or, where applicable, TIdIOHandlerSSLBase) to replace the default handler, for example to plug a specialized OpenSSL or SChannel implementation. Leave aSSLHandler unassigned to let the server create the default handler; in that case OnSSLAfterCreateHandler can still be used to tweak properties after creation. The component takes ownership of the handler assigned here and will free it when the server is destroyed.

Example


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

Back to Events