TsgcWebSocketLoadBalancerServerEvents › OnSSLAfterCreateHandler

OnSSLAfterCreateHandler Event

Fires after the load balancer creates the SSL handler so its properties can be customized before the TLS handshake.

Syntax

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

Default Value

Remarks

If OnSSLGetHandler does not supply a custom SSL handler, the load balancer creates the default one (OpenSSL or SChannel depending on the selected IOHandler) and then raises OnSSLAfterCreateHandler so the application can tune its properties, for example to force a specific TLS method, configure additional OpenSSL options, or adjust session caching. 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 it must not be freed by the handler code.

Example


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

Back to Events