TsgcWebSocketClient › Propiedades › TLSOptions
Configura certificados, versión TLS, ALPN, IOHandler y otros detalles de conexión segura utilizados cuando TLS está habilitado.
property TLSOptions: TsgcWSTLS_Options read FTLSOptions write SetTLSOptions;
—
Accesible solo cuando TLS es True. Las subpropiedades incluyen RootCertFile, CertFile, KeyFile, Password, VerifyCertificate, VerifyDepth, Version (desde tlsUndefined hasta tls1_3), ALPNProtocols y IOHandler (iohOpenSSL, iohSChannel, iohAndroidTLS o iohAppleTLS). En Android, iohAndroidTLS utiliza el TLS nativo de la plataforma (javax.net.ssl.SSLEngine) y en iOS y macOS, iohAppleTLS utiliza el TLS nativo de Apple, por lo que no es necesario desplegar bibliotecas de OpenSSL; el TLS nativo de la plataforma requiere la edición Enterprise. La configuración específica de OpenSSL reside bajo OpenSSL_Options y la configuración específica de SChannel bajo SChannel_Options.
oClient := TsgcWebSocketClient.Create(nil);
oClient.URL := 'wss://www.esegece.com:2053';
oClient.TLSOptions.Version := tls1_2;
oClient.TLSOptions.VerifyCertificate := true;
oClient.TLSOptions.RootCertFile := 'cacert.pem';
oClient.Active := true;