TsgcHTTP2Client › Proprietà › TLSOptions
Configura certificati, versione TLS, ALPN, IOHandler e altri dettagli della connessione sicura utilizzati per HTTP/2 su TLS.
property TLSOptions: TsgcTCPTLS_Options read FTLSOptions write SetTLSOptions;
—
Utilizzato quando TLS è True. Le sotto-proprietà includono RootCertFile, CertFile, KeyFile, Password, VerifyCertificate, VerifyDepth, Version (da tlsUndefined a tls1_3), ALPNProtocols e IOHandler (iohOpenSSL o iohSChannel). HTTP/2 richiede ALPN per pubblicizzare il protocollo h2 durante l'handshake TLS; il componente popola automaticamente l'elenco ALPN con h2, ma ALPNProtocols può essere esteso se il server si aspetta identificatori aggiuntivi. Le impostazioni specifiche di OpenSSL si trovano sotto OpenSSL_Options e quelle specifiche di SChannel sotto SChannel_Options. Per HTTP/2 è consigliato TLS 1.2 o superiore.
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';