TsgcHTTP2ClientPropiedades › TLSOptions

TLSOptions Propiedad

Configura certificados, versión TLS, ALPN, IOHandler y otros detalles de conexión segura usados para HTTP/2 sobre TLS.

Sintaxis

property TLSOptions: TsgcTCPTLS_Options read FTLSOptions write SetTLSOptions;

Valor Predeterminado

Observaciones

Se utiliza cuando TLS es True. Las subpropiedades incluyen RootCertFile, CertFile, KeyFile, Password, VerifyCertificate, VerifyDepth, Version (de tlsUndefined a tls1_3), ALPNProtocols e IOHandler (iohOpenSSL o iohSChannel). HTTP/2 requiere ALPN para anunciar el protocolo h2 durante el handshake TLS; el componente rellena la lista ALPN con h2 automáticamente, pero ALPNProtocols puede ampliarse si el servidor espera identificadores adicionales. La configuración específica de OpenSSL se encuentra en OpenSSL_Options y la de SChannel en SChannel_Options. Se recomienda TLS 1.2 o superior para HTTP/2.

Ejemplo


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';

Volver a Propiedades