TsgcHTTP2Client属性 › TLSOptions

TLSOptions 属性

配置 HTTP/2 over TLS 所使用的证书、TLS 版本、ALPN、IOHandler 及其他安全连接细节。

语法

property TLSOptions: TsgcTCPTLS_Options read FTLSOptions write SetTLSOptions;

默认值

备注

TLSTrue 时使用。子属性包括 RootCertFileCertFileKeyFilePasswordVerifyCertificateVerifyDepthVersion(从 tlsUndefinedtls1_3)、ALPNProtocolsIOHandleriohOpenSSLiohSChannel)。HTTP/2 需要 ALPN 在 TLS 握手期间通告 h2 协议;组件会自动将 h2 填充到 ALPN 列表,但如果服务器需要其他标识符,可扩展 ALPNProtocols。OpenSSL 特定设置在 OpenSSL_Options 下,SChannel 特定设置在 SChannel_Options 下。HTTP/2 建议使用 TLS 1.2 或更高版本。

示例


oHTTP2 := TsgcHTTP2Client.Create(nil);
oHTTP2.Host := 'http2.akamai.com';
oHTTP2.Port := 443;
oHTTP2.TLS := True;
oHTTP2.TLSOptions.Version := tls1_2;
oHTTP2.TLSOptions.VerifyCertificate := True;
oHTTP2.TLSOptions.RootCertFile := 'cacert.pem';

返回属性