TsgcWebSocketLoadBalancerServer › Events › OnSSLGetHandler
Fires before the SSL handler is created so a custom server-side handler instance can be supplied to the load balancer.
property OnSSLGetHandler: TsgcWSOnSSLGetHandler;
// TsgcWSOnSSLGetHandler = procedure(Sender: TObject; aType: TwsSSLHandler; var aSSLHandler: TIdSSLIOHandlerSocketBase) of object
—
OnSSLGetHandler is raised just before the load balancer builds the TLS IOHandler used for SSL bindings. Assign aSSLHandler to an instance of your own class inherited from TIdServerIOHandlerSSLBase (or TIdIOHandlerSSLBase when the load balancer needs a client-side handler to reach a backend over TLS) to replace the default handler, for example to plug a specialized OpenSSL or SChannel implementation. Leave aSSLHandler unassigned to let the component 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.
procedure OnSSLGetHandler(Sender: TObject; aType: TwsSSLHandler;
var aSSLHandler: TIdSSLIOHandlerSocketBase);
begin
aSSLHandler := TCustomServerSSLHandler.Create(nil);
// ... configure handler properties
end;