TsgcHTTP2ClientProperties › TLSOptions

TLSOptions Property

Configures certificates, TLS version, ALPN, IOHandler and other secure-connection details used for HTTP/2 over TLS.

Syntax

property TLSOptions: TsgcTCPTLS_Options read FTLSOptions write SetTLSOptions;

Default Value

Remarks

Used when TLS is True. Sub-properties include RootCertFile, CertFile, KeyFile, Password, VerifyCertificate, VerifyDepth, Version (from tlsUndefined through tls1_3), ALPNProtocols and IOHandler (iohOpenSSL or iohSChannel). HTTP/2 requires ALPN to advertise the h2 protocol during the TLS handshake; the component populates the ALPN list with h2 automatically but ALPNProtocols can be extended if the server expects additional identifiers. OpenSSL-specific settings live under OpenSSL_Options and SChannel-specific settings under SChannel_Options. TLS 1.2 or higher is recommended for HTTP/2.

Example


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

Back to Properties