TsgcWebSocketClient › Właściwości › TLSOptions
Konfiguruje certyfikaty, wersję TLS, ALPN, IOHandler i inne szczegóły bezpiecznego połączenia używane gdy TLS jest włączony.
property TLSOptions: TsgcWSTLS_Options read FTLSOptions write SetTLSOptions;
—
Dostępne tylko wtedy, gdy TLS ma wartość True. Podwłaściwości obejmują RootCertFile, CertFile, KeyFile, Password, VerifyCertificate, VerifyDepth, Version (od tlsUndefined po tls1_3), ALPNProtocols oraz IOHandler (iohOpenSSL, iohSChannel, iohAndroidTLS lub iohAppleTLS). W systemie Android iohAndroidTLS używa natywnego TLS platformy (javax.net.ssl.SSLEngine), a w iOS i macOS iohAppleTLS używa natywnego TLS firmy Apple, dzięki czemu nie trzeba wdrażać żadnych bibliotek OpenSSL; natywny TLS platformy wymaga edycji Enterprise. Ustawienia specyficzne dla OpenSSL znajdują się w OpenSSL_Options, a ustawienia specyficzne dla SChannel w 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;