TsgcHTTP2Client › Propriedades › TLSOptions
Configura certificados, versão TLS, ALPN, IOHandler e outros detalhes de conexão segura utilizados para HTTP/2 sobre TLS.
property TLSOptions: TsgcTCPTLS_Options read FTLSOptions write SetTLSOptions;
—
Usado quando TLS é True. As subpropriedades incluem RootCertFile, CertFile, KeyFile, Password, VerifyCertificate, VerifyDepth, Version (de tlsUndefined até tls1_3), ALPNProtocols e IOHandler (iohOpenSSL ou iohSChannel). O HTTP/2 requer ALPN para anunciar o protocolo h2 durante o handshake TLS; o componente preenche a lista ALPN com h2 automaticamente, mas ALPNProtocols pode ser estendido se o servidor esperar identificadores adicionais. As configurações específicas do OpenSSL ficam em OpenSSL_Options e as específicas do SChannel em SChannel_Options. TLS 1.2 ou superior é recomendado para HTTP/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';