TsgcWebSocketServerEvents › OnSSLAfterCreateHandler

OnSSLAfterCreateHandler Event

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

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 server 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: TIdServerIOHandlerSSLBase);
begin
  TIdServerIOHandlerSSLOpenSSL(aSSLHandler).SSLOptions.Method := sslvTLSv1_2;
end;

Back to Events