TsgcWebSocketClient › 属性 › TLSOptions
配置 TLS 启用时使用的证书、TLS 版本、ALPN、IOHandler 及其他安全连接详情。
property TLSOptions: TsgcWSTLS_Options read FTLSOptions write SetTLSOptions;
—
仅当 TLS 为 True 时可访问。子属性包括 RootCertFile、CertFile、KeyFile、Password、VerifyCertificate、VerifyDepth、Version(从 tlsUndefined 到 tls1_3)、ALPNProtocols 和 IOHandler(iohOpenSSL 或 iohSChannel)。OpenSSL 特定设置位于 OpenSSL_Options 下,SChannel 特定设置位于 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;